diff --git a/Ooui.Wasm/Makefile b/Ooui.Wasm/Makefile new file mode 100644 index 0000000..7151ccf --- /dev/null +++ b/Ooui.Wasm/Makefile @@ -0,0 +1,9 @@ + +all: + msbuild /t:Restore ../Ooui.Forms/Ooui.Forms.csproj + msbuild ../Ooui.Forms/Ooui.Forms.csproj + cp ../Ooui.Forms/bin/Debug/netstandard1.0/Ooui.Forms.dll managed/ + cp ../Ooui/bin/Debug/netstandard1.0/Ooui.dll managed/ + csc /nostdlib /target:library \ + /r:managed/mscorlib.dll /r:managed/System.Runtime.dll /r:managed/Xamarin.Forms.Core.dll /r:managed/Xamarin.Forms.Xaml.dll /r:managed/Ooui.dll /r:managed/Ooui.Forms.dll \ + /out:managed/Ooui.Sample.dll ../Samples/ISample.cs ../Samples/XamlPreviewPageSample.cs ooui-sample.cs diff --git a/Ooui.Wasm/ooui-sample.cs b/Ooui.Wasm/ooui-sample.cs index 896bd1c..637d962 100644 --- a/Ooui.Wasm/ooui-sample.cs +++ b/Ooui.Wasm/ooui-sample.cs @@ -16,9 +16,9 @@ public class Program return e; } - static Element GetBoxViewClockElement () + static Element GetXamarinFormsElement () { - var s = new Samples.BoxViewClockSample (); + var s = new Samples.XamlPreviewPageSample (); return s.CreateElement (); } @@ -26,7 +26,7 @@ public class Program { Xamarin.Forms.Forms.Init (); try { - var e = GetBoxViewClockElement (); + var e = GetXamarinFormsElement (); UI.SetGlobalElement ("main", e); return e.ToString (); } diff --git a/Ooui.Wasm/ooui-sample.html b/Ooui.Wasm/ooui-sample.html index 1a610a9..5c649fb 100644 --- a/Ooui.Wasm/ooui-sample.html +++ b/Ooui.Wasm/ooui-sample.html @@ -21,6 +21,7 @@ "Newtonsoft.Json.dll", "System.dll", "System.Collections.dll", + "System.ComponentModel.dll", "System.ComponentModel.TypeConverter.dll", "System.Core.dll", "System.Diagnostics.Debug.dll", diff --git a/Ooui/UI.cs b/Ooui/UI.cs index dc87fa9..6a00b97 100644 --- a/Ooui/UI.cs +++ b/Ooui/UI.cs @@ -596,15 +596,17 @@ namespace Ooui } } - public static void StartWebAssemblySession (string sessionId, string globalElementId) + public static void StartWebAssemblySession (string sessionId, string globalElementId, string initialSize) { Element element; lock (globalElements) { if (!globalElements.TryGetValue (globalElementId, out element)) return; } - - var g = new WebAssemblySession (sessionId, element, 640, 480); + var ops = initialSize.Split (' '); + var initialWidth = double.Parse (ops[0]); + var initialHeight = double.Parse (ops[1]); + var g = new WebAssemblySession (sessionId, element, initialWidth, initialHeight); lock (globalElementSessions) { globalElementSessions[sessionId] = g; }