Exemple #1
0
        public static PreloadedWindow GetInstance()
        {
            var instance = s_precreated;

            s_precreated = null;
            return(instance);
        }
Exemple #2
0
        protected override void OnPreCreate()
        {
            base.OnPreCreate();
            Application.ClearCurrent();

            if (DotnetUtil.TizenAPIVersion < 5)
            {
                // We should set the env variable to support IsolatedStorageFile on tizen 4.0 or lower version.
                Environment.SetEnvironmentVariable("XDG_DATA_HOME", Current.DirectoryInfo.Data);
            }

            var type = typeof(EWindow);
            // Use reflection to avoid breaking compatibility. ElmSharp.Window.CreateWindow() is has been added since API6.
            var     methodInfo = type.GetMethod("CreateWindow", BindingFlags.NonPublic | BindingFlags.Static);
            EWindow window     = null;

            if (methodInfo != null)
            {
                window              = (EWindow)methodInfo.Invoke(null, new object[] { "FormsWindow" });
                BaseLayout          = (ELayout)window.GetType().GetProperty("BaseLayout")?.GetValue(window);
                BaseCircleSurface   = (CircleSurface)window.GetType().GetProperty("BaseCircleSurface")?.GetValue(window);
                Forms.CircleSurface = BaseCircleSurface;
            }
            else             // in case of Xamarin Preload
            {
                window = PreloadedWindow.GetInstance() ?? new EWindow("FormsWindow");
                if (window is PreloadedWindow precreated)
                {
                    BaseLayout = precreated.BaseLayout;
                }
            }
            MainWindow = window;
        }
Exemple #3
0
 public PreloadedWindow() : base("FormsWindow-pre")
 {
     s_precreated = this;
     Initialize();
 }