From 7522fe0ce522704a0a05d35a95928ed96e3763a1 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Fri, 23 Mar 2018 15:47:38 -0700 Subject: [PATCH] Add LoadApplication method This allows a WASM Ooui app to act like a native Forms app. Fixes #106 --- Ooui.Forms/Forms.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Ooui.Forms/Forms.cs b/Ooui.Forms/Forms.cs index 235927e..a10929f 100644 --- a/Ooui.Forms/Forms.cs +++ b/Ooui.Forms/Forms.cs @@ -150,5 +150,14 @@ namespace Xamarin.Forms public VisualElement View { get; set; } public Ooui.Element NativeView { get; set; } } + + public static void LoadApplication (Application application) + { + Application.Current = application; + var mainPage = application.MainPage; + if (mainPage != null) { + UI.Publish ("/", application.MainPage.GetOouiElement ()); + } + } } }