</PropertyGroup>
<ItemGroup>
- <PackageReference Include="Tizen.NET" Version="6.0.0.14995" />
+ <PackageReference Include="Tizen.NET" Version="7.0.0.15140" />
<PackageReference Include="System.Memory" Version="4.5.3" />
</ItemGroup>
using ELayout = ElmSharp.Layout;
using DeviceOrientation = Xamarin.Forms.Internals.DeviceOrientation;
using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
+using PTizen = Xamarin.Forms.Platform.Tizen;
using ElmSharp.Wearable;
using Tizen.Wearable.CircularUI.Forms;
Init(dummyApp, false);
IsPreloaded = true;
- EWindow eWindow = null;
- ELayout eLayout = null;
- CircleSurface eCircleSurface = 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);
- eCircleSurface = (CircleSurface)eWindow.GetType().GetProperty("BaseCircleSurface")?.GetValue(eWindow);
- }
-
- PreloadedWindow preloadedWindow = null;
- if (eWindow != null && eLayout != null)
- {
- preloadedWindow = new PreloadedWindow(eWindow, eLayout, eCircleSurface);
- }
- else
- {
- preloadedWindow = new PreloadedWindow();
- }
-
var locale = TSystemSetting.LocaleLanguage;
TSystemSetting.LocaleLanguageChanged += DummyHandler;
TSystemSetting.LocaleLanguageChanged -= DummyHandler;
{
System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(type.TypeHandle);
}
- global::Xamarin.Forms.Platform.Tizen.Native.NativeFactory.PrecreateNatives(preloadedWindow.Window);
- global::Tizen.Wearable.CircularUI.Forms.CircularUIForms.Preload(preloadedWindow.Window);
+ PTizen.PreloadedWindow preloadedWindow = new PTizen.PreloadedWindow();
+ if (preloadedWindow.Window != null)
+ {
+ global::Xamarin.Forms.Platform.Tizen.Native.NativeFactory.PrecreateNatives(preloadedWindow.Window);
+ global::Tizen.Wearable.CircularUI.Forms.CircularUIForms.Preload(preloadedWindow.Window);
+ }
+ else
+ {
+ Console.WriteLine("PreloadedWindow is null");
+ }
return preloadedWindow.Window;
}
}
{
base.OnPreCreate();
Application.ClearCurrent();
- PreloadedWindow window = PreloadedWindow.GetInstance() ?? new PreloadedWindow();
+ PreloadedWindow window = PreloadedWindow.GetInstance() ?? new PreloadedWindow(false);
MainWindow = window.Window;
- MainWindow.Show();
- if (window.BaseConformant != null)
- {
- window.BaseConformant.Show();
- }
-
BaseLayout = window.BaseLayout;
- BaseLayout.Show();
-
BaseCircleSurface = window.BaseCircleSurface;
Forms.CircleSurface = BaseCircleSurface;
}
using ElmSharp;
using ElmSharp.Wearable;
+using EWindow = ElmSharp.Window;
using ELayout = ElmSharp.Layout;
-using EConformant = ElmSharp.Conformant;
+using System.Reflection;
+using System;
namespace Xamarin.Forms.Platform.Tizen
{
{
static PreloadedWindow s_precreated;
- public PreloadedWindow()
+ public PreloadedWindow(bool useReflection = true)
{
- s_precreated = this;
- Initialize();
- }
-
- public PreloadedWindow(Window win, ELayout layout, CircleSurface circleSurface)
- {
- s_precreated = this;
- Window = win;
- BaseLayout = layout;
- BaseCircleSurface = circleSurface;
+ Initialize(useReflection);
}
public Window Window
protected set;
}
- public EConformant BaseConformant
- {
- get;
- protected set;
- }
-
public ELayout BaseLayout
{
get;
get; protected set;
}
- protected void Initialize()
+ protected void Initialize(bool useReflection = true)
{
- Window = new Window("FormsWindow");
+ if (useReflection)
+ {
+ var typeWin = typeof(ElmSharp.PreloadedWindow);
+ var methodInfo = typeWin.GetMethod("PeekInstance", BindingFlags.Public | BindingFlags.Static);
+ if (methodInfo != null)
+ {
+ Window = (EWindow)methodInfo.Invoke(null, null);
+ BaseLayout = (ELayout)Window?.GetType().GetProperty("BaseLayout")?.GetValue(Window);
+ BaseCircleSurface = (CircleSurface)Window?.GetType().GetProperty("BaseCircleSurface")?.GetValue(Window);
+ s_precreated = this;
+ }
+ }
+ else
+ {
+ Window = new Window("FormsWindow");
+ Window.Show();
- var conformant = new Conformant(Window);
- BaseConformant = conformant;
+ var conformant = new Conformant(Window);
+ conformant.Show();
- var layout = new ELayout(conformant);
- layout.SetTheme("layout", "application", "default");
+ var layout = new ELayout(conformant);
+ layout.SetTheme("layout", "application", "default");
- BaseLayout = layout;
+ BaseLayout = layout;
+ BaseLayout.Show();
- if (Device.Idiom == TargetIdiom.Watch)
- {
- BaseCircleSurface = new CircleSurface(conformant);
+ if (Device.Idiom == TargetIdiom.Watch)
+ {
+ BaseCircleSurface = new CircleSurface(conformant);
+ }
+ conformant.SetContent(BaseLayout);
}
- conformant.SetContent(BaseLayout);
}
public static PreloadedWindow GetInstance()