Ooui-tws-port/Samples/XamarinFormsSample.cs

41 lines
861 B
C#
Raw Normal View History

2017-11-09 07:12:59 +00:00
using System;
using Xamarin.Forms;
using Ooui.Forms;
namespace Samples
{
public class XamarinFormsSample
{
public void Publish ()
{
Forms.Init ();
var countLabel = new Label {
Text = "0",
2017-11-09 22:17:36 +00:00
BackgroundColor = Color.Gold,
2017-11-09 07:12:59 +00:00
};
var countButton = new Button {
2017-11-10 00:09:48 +00:00
Text = "Increase",
VerticalOptions = LayoutOptions.FillAndExpand,
2017-11-09 07:12:59 +00:00
};
countButton.Clicked += (sender, e) => {
var v = int.Parse (countLabel.Text);
countLabel.Text = (v + 1).ToString ();
};
var page = new ContentPage {
Content = new StackLayout {
2017-11-09 22:17:36 +00:00
BackgroundColor = Color.Khaki,
2017-11-09 07:12:59 +00:00
Children = {
new Label { Text = "Hello World!" },
countLabel,
countButton,
},
},
};
page.Publish ("/xamarin-forms");
page.PublishShared ("/xamarin-forms-shared");
}
}
}