using Tizen.Applications;
using TSystemInfo = Tizen.System.Information;
using TSystemSetting = Tizen.System.SystemSettings;
+using EWindow = ElmSharp.Window;
using ELayout = ElmSharp.Layout;
using DeviceOrientation = Xamarin.Forms.Internals.DeviceOrientation;
using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
{
Forms.Init();
- var window = new PreloadedWindow();
-
- //Elmsharp preload, this should be removed if Elmsharp preload PR is merged in dotnet-launcher.
- new ElmSharp.Entry(window).Unrealize();
- new Scroller(window).Unrealize();
- new Box(window).Unrealize();
- new ElmSharp.Label(window).Unrealize();
- new GenList(window).Unrealize();
- new ElmSharp.Button(window).Unrealize();
- new Check(window).Unrealize();
- new Naviframe(window).Unrealize();
- new ElmSharp.Slider(window).Unrealize();
- new Spinner(window).Unrealize();
- new ElmSharp.ProgressBar(window).Unrealize();
- new GestureLayer(window).Unrealize();
- new Polygon(window).Unrealize();
- new ElmSharp.Image(window).Unrealize();
- window.BackButtonPressed += DummyHandler;
- window.BackButtonPressed -= DummyHandler;
+ EWindow eWindow = null;
+ ELayout eLayout = null;
+ var typeWin = typeof(EWindow);
+ var methodInfo = typeWin.GetMethod("CreateWindow", BindingFlags.NonPublic | BindingFlags.Static);
+ if (methodInfo != null)
+ {
+ eWindow = (EWindow)methodInfo.Invoke(null, new object[] { "FormsWindow" });
+ eLayout = (ELayout)eWindow.GetType().GetProperty("BaseLayout")?.GetValue(eWindow);
+ }
+
+ PreloadedWindow preloadedWindow = null;
+ if (eWindow != null && eLayout != null)
+ {
+ preloadedWindow = new PreloadedWindow(eWindow, eLayout);
+ }
+ else
+ {
+ preloadedWindow = new PreloadedWindow();
+ }
var locale = TSystemSetting.LocaleLanguage;
TSystemSetting.LocaleLanguageChanged += DummyHandler;
{
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(type.TypeHandle);
}
- global::Xamarin.Forms.Platform.Tizen.Native.NativeFactory.PrecreateNatives(window);
+ global::Xamarin.Forms.Platform.Tizen.Native.NativeFactory.PrecreateNatives(preloadedWindow.Window);
- return window;
+ return preloadedWindow.Window;
}
}
namespace Xamarin.Forms.Platform.Tizen
{
- public class PreloadedWindow : Window
+ public class PreloadedWindow
{
static PreloadedWindow s_precreated;
- public PreloadedWindow() : base("FormsWindow-pre")
+ public PreloadedWindow()
{
s_precreated = this;
Initialize();
}
+ public PreloadedWindow(Window win, ELayout layout)
+ {
+ s_precreated = this;
+ Window = win;
+ BaseLayout = layout;
+ }
+
+ public Window Window
+ {
+ get;
+ protected set;
+ }
+
public ELayout BaseLayout
{
get;
protected void Initialize()
{
- var conformant = new Conformant(this);
+ Window = new Window("FormsWindow");
+ Window.Show();
+
+ var conformant = new Conformant(Window);
conformant.Show();
var layout = new ELayout(conformant);