Ooui-tws-port/Ooui.Forms/PageExtensions.cs

27 lines
662 B
C#
Raw Normal View History

2017-11-09 06:21:05 +00:00
using System;
2017-11-09 07:12:59 +00:00
2017-11-09 06:21:05 +00:00
namespace Ooui.Forms
{
public static class PageExtensions
{
2017-11-09 07:12:59 +00:00
public static void Publish (this Xamarin.Forms.Page page, string path)
{
UI.Publish (path, () => page.CreateElement ());
}
public static void PublishShared (this Xamarin.Forms.Page page, string path)
{
var lazyPage = new Lazy<Element> ((() => page.CreateElement ()), true);
UI.Publish (path, () => lazyPage.Value);
}
2017-11-09 06:21:05 +00:00
public static Element CreateElement (this Xamarin.Forms.Page page)
{
2017-11-09 07:12:59 +00:00
if (!Xamarin.Forms.Forms.IsInitialized)
throw new InvalidOperationException ("call Forms.Init() before this");
2017-11-09 06:21:05 +00:00
throw new NotImplementedException ();
}
}
}