Fix initial Forms size
This commit is contained in:
parent
1f5b1fe13a
commit
64e6602e79
|
@ -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
|
|
@ -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 ();
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue