Organize samples
This commit is contained in:
parent
ecd9683a26
commit
010d1f75d0
|
@ -0,0 +1,16 @@
|
|||
using Ooui;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Samples
|
||||
{
|
||||
public class ButtonXamlSample : ISample
|
||||
{
|
||||
public string Title => "Xamarin.Forms Button XAML";
|
||||
|
||||
public Ooui.Element CreateElement ()
|
||||
{
|
||||
var page = new ButtonXaml.ButtonXamlPage ();
|
||||
return page.GetOouiElement ();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Samples.DisplayAlertSample">
|
||||
x:Class="Samples.DisplayAlertPage">
|
||||
<ContentPage.Content>
|
||||
<StackLayout>
|
||||
<Label Text="Welcome to DisplayAlert Sample!" />
|
|
@ -7,9 +7,9 @@ using Xamarin.Forms.Xaml;
|
|||
namespace Samples
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class DisplayAlertSample : ContentPage
|
||||
public partial class DisplayAlertPage : ContentPage
|
||||
{
|
||||
public DisplayAlertSample ()
|
||||
public DisplayAlertPage ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
}
|
||||
|
@ -19,11 +19,5 @@ namespace Samples
|
|||
var result = await DisplayAlert("Alert Message", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa.", "YES", "NO");
|
||||
await DisplayAlert("Alert Response", $"You selected value: {result}", "OK");
|
||||
}
|
||||
|
||||
public void Publish()
|
||||
{
|
||||
var sample = new XamlPageSample();
|
||||
UI.Publish("/display-alert", sample.CreateElement(this));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using Ooui;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Samples
|
||||
{
|
||||
public class DisplayAlertSample : ISample
|
||||
{
|
||||
public string Title => "Xamarin.Forms DisplayAlert";
|
||||
|
||||
public Ooui.Element CreateElement ()
|
||||
{
|
||||
var page = new DisplayAlertPage ();
|
||||
return page.GetOouiElement ();
|
||||
}
|
||||
|
||||
public void Publish ()
|
||||
{
|
||||
UI.Publish ("/display-alert", CreateElement);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,8 +18,11 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="DisplayAlertSample.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
<Compile Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="ButtonXamlPage.xaml.cs">
|
||||
<DependentUpon>*.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Condition=" '$(EnableDefaultCompileItems)' == 'true' " Update="DisplayAlertPage.xaml.cs">
|
||||
<DependentUpon>*.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -27,7 +30,7 @@
|
|||
<EmbeddedResource Update="ButtonXamlPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Update="DisplayAlertSample.xaml">
|
||||
<EmbeddedResource Update="DisplayAlertPage.xaml">
|
||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
using Xamarin.Forms;
|
||||
|
||||
namespace Samples
|
||||
{
|
||||
public class XamlPageSample
|
||||
{
|
||||
public string Title => "Xamarin.Forms Button XAML";
|
||||
|
||||
public Ooui.Element CreateElement (Page page)
|
||||
{
|
||||
return page.GetOouiElement ();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue