Add XAML example
This commit is contained in:
parent
64cc7a22d8
commit
f550c55e90
|
@ -0,0 +1,9 @@
|
|||
<?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="ButtonXaml.ButtonXamlPage">
|
||||
|
||||
<Button Text="Tap for click count!"
|
||||
Clicked="OnButtonClicked" />
|
||||
|
||||
</ContentPage>
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace ButtonXaml
|
||||
{
|
||||
public partial class ButtonXamlPage
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
public ButtonXamlPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void OnButtonClicked(object sender, EventArgs args)
|
||||
{
|
||||
count++;
|
||||
|
||||
((Button)sender).Text =
|
||||
String.Format("{0} click{1}!", count, count == 1 ? "" : "s");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using Ooui;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Samples
|
||||
{
|
||||
public class ButtonXamlPageSample : ISample
|
||||
{
|
||||
public string Title => "Xamarin.Forms Button XAML";
|
||||
|
||||
public Ooui.Element CreateElement ()
|
||||
{
|
||||
var page = new ButtonXaml.ButtonXamlPage ();
|
||||
return page.GetOouiElement ();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,6 +8,9 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Xamarin.Forms" Version="2.4.0.38779" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="**/*" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
|
|
Loading…
Reference in New Issue