Ejemplo n.º 1
0
        public TizenHost(Func <WinUI.Application> appBuilder, string[] args = null)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            _current = this;

            _appBuilder = appBuilder;
            _args       = args;


            _args ??= Environment
            .GetCommandLineArgs()
            .Skip(1)
            .ToArray();

            bool EnqueueNative(DispatcherQueuePriority priority, DispatcherQueueHandler callback)
            {
                EcoreMainloop.PostAndWakeUp(() => callback());

                return(true);
            }

            Windows.System.DispatcherQueue.EnqueueNativeOverride = EnqueueNative;

            Windows.UI.Core.CoreDispatcher.DispatchOverride        = (d) => EcoreMainloop.PostAndWakeUp(d);
            Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => EcoreMainloop.IsMainThread;

            _tizenApplication = new TizenApplication(this);
            _tizenApplication.Run(_args);
        }
Ejemplo n.º 2
0
        public TizenHost(Func <WinUI.Application> appBuilder, string[]?args = null)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            _current = this;

            _appBuilder = appBuilder;

            Windows.UI.Core.CoreDispatcher.DispatchOverride        = (d) => EcoreMainloop.PostAndWakeUp(d);
            Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => EcoreMainloop.IsMainThread;

            _tizenApplication = new TizenApplication(this);
            _tizenApplication.Run(args);
        }
Ejemplo n.º 3
0
        public TizenHost(Func <WinUI.Application> appBuilder)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            _current = this;

            _appBuilder = appBuilder;

            Windows.UI.Core.CoreDispatcher.DispatchOverride        = (d) => EcoreMainloop.PostAndWakeUp(d);
            Windows.UI.Core.CoreDispatcher.HasThreadAccessOverride = () => EcoreMainloop.IsMainThread;

            _tizenApplication = new TizenApplication(this);
            _tizenApplication.Run(Environment.GetCommandLineArgs());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a WpfHost element to host a Uno-Skia into a WPF application.
        /// </summary>
        /// <remarks>
        /// If args are omitted, those from Environment.GetCommandLineArgs() will be used.
        /// </remarks>
        public TizenHost(Func <WinUI.Application> appBuilder, string[] args = null)
        {
            Elementary.Initialize();
            Elementary.ThemeOverlay();

            _current = this;

            _appBuilder = appBuilder;
            _args       = args;


            _args ??= Environment
            .GetCommandLineArgs()
            .Skip(1)
            .ToArray();

            Windows.UI.Core.CoreDispatcher.DispatchOverride
                = (d) => EcoreMainloop.PostAndWakeUp(d);

            _tizenApplication = new TizenApplication(this);
            _tizenApplication.Run(_args);
        }