Skip to content

Commit 30168fd

Browse files
committed
Updated example with XAML file to verify that xaml works for the WizardLayout.
1 parent 76033a4 commit 30168fd

5 files changed

Lines changed: 42 additions & 2 deletions

File tree

NControl.ControlsDemo/NControl.Controls.Demo.FormsApp/MyApp.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public MyApp ()
2727
new SvgImagePage(),
2828
new CalendarPage(),
2929
new WizardPage(),
30+
new WizardPageXaml(),
3031
new RepeaterPage(),
3132
};
3233

NControl.ControlsDemo/NControl.Controls.Demo.FormsApp/NControl.Controls.Demo.FormsApp.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
<Compile Include="SvgImagePage.cs" />
5353
<Compile Include="WizardPage.cs" />
5454
<Compile Include="RepeaterPage.cs" />
55+
<Compile Include="WizardPageXaml.xaml.cs">
56+
<DependentUpon>WizardPageXaml.xaml</DependentUpon>
57+
</Compile>
5558
</ItemGroup>
5659
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
5760
<ItemGroup>
@@ -65,6 +68,9 @@
6568
<EmbeddedResource Include="Resources\Svg\Smile.svg" />
6669
<EmbeddedResource Include="Resources\Svg\Arrows.svg" />
6770
<EmbeddedResource Include="Resources\Svg\SpaceShips.svg" />
71+
<EmbeddedResource Include="WizardPageXaml.xaml">
72+
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
73+
</EmbeddedResource>
6874
</ItemGroup>
6975
<ItemGroup>
7076
<Reference Include="NGraphics">

NControl.ControlsDemo/NControl.Controls.Demo.FormsApp/WizardPage.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ protected override void OnAppearing ()
1414
{
1515
base.OnAppearing ();
1616

17-
var wizard = new WizardLayout ();
18-
wizard.Pages = new View[]{
17+
WizardLayout wizard = null;
18+
wizard = new WizardLayout {
19+
Pages = {
1920
new Button {
2021
Command = new Command((obj)=>wizard.Page++),
2122
Text = "Page 2",
@@ -34,6 +35,7 @@ protected override void OnAppearing ()
3435
new Button {
3536
Text = "Done",
3637
}
38+
}
3739
};
3840

3941
Content = wizard;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ContentPage
3+
xmlns="http://xamarin.com/schemas/2014/forms"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
5+
xmlns:ncontrols="clr-namespace:NControl.Controls;assembly=NControl.Controls"
6+
x:Class="NControl.Controls.Demo.FormsApp.WizardPageXaml">
7+
<ContentPage.Content>
8+
<ncontrols:WizardLayout>
9+
<ncontrols:WizardLayout.Pages>
10+
<ContentView><Label Text="Page 1"/></ContentView>
11+
<ContentView><Label Text="Page 1"/></ContentView>
12+
</ncontrols:WizardLayout.Pages>
13+
</ncontrols:WizardLayout>
14+
</ContentPage.Content>
15+
</ContentPage>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
using Xamarin.Forms;
5+
6+
namespace NControl.Controls.Demo.FormsApp
7+
{
8+
public partial class WizardPageXaml : ContentPage
9+
{
10+
public WizardPageXaml()
11+
{
12+
InitializeComponent();
13+
Title = "WizardLayout XAML";
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)