2017-12-16 12:06:34 +00:00
|
|
|
|
using Ooui;
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Samples
|
|
|
|
|
{
|
|
|
|
|
public class TimePickerSample : ISample
|
|
|
|
|
{
|
|
|
|
|
public string Title => "Xamarin.Forms TimePicker Sample";
|
2018-09-02 04:56:35 +00:00
|
|
|
|
public string Path => "/timepicker";
|
2017-12-16 12:06:34 +00:00
|
|
|
|
|
|
|
|
|
public Ooui.Element CreateElement()
|
|
|
|
|
{
|
|
|
|
|
var panel = new StackLayout();
|
|
|
|
|
|
|
|
|
|
var titleLabel = new Xamarin.Forms.Label
|
|
|
|
|
{
|
|
|
|
|
Text = "TimePicker",
|
|
|
|
|
FontSize = 24,
|
|
|
|
|
FontAttributes = FontAttributes.Bold
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
panel.Children.Add(titleLabel);
|
|
|
|
|
|
|
|
|
|
var timePicker = new TimePicker();
|
|
|
|
|
panel.Children.Add(timePicker);
|
|
|
|
|
|
|
|
|
|
var page = new ContentPage
|
|
|
|
|
{
|
|
|
|
|
Content = panel
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return page.GetOouiElement();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Publish()
|
|
|
|
|
{
|
2023-03-17 08:08:32 +00:00
|
|
|
|
PageExtensions.Ui.Publish(Path, CreateElement);
|
2017-12-16 12:06:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|