Exemplo n.º 1
0
        protected override void OnLaunched(LaunchActivatedEventArgs args)
        {
            var window = Window.Current.CoreWindow;

            if (CoreWindow != window)
            {
                window.VisibilityChanged += visibilityChanged;
            }
            CoreWindow = window;

            if (coreMetroWindow != null)
            {
                coreMetroWindow.Dispose();
            }
            coreMetroWindow = new CoreMetroWindow(this, Window.Current.CoreWindow, theEvent, false);
            FrameSize       = new Size2(coreMetroWindow.ConvertDipsToPixels(window.Bounds.Width), coreMetroWindow.ConvertDipsToPixels(window.Bounds.Height));

            if (Window.Current.Content as ApplicationPage == null)
            {
                /*if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
                 * {
                 *  //TODO: Load state from previously suspended application
                 * }*/

                Window.Current.Content = new ApplicationPage(desc.WinRTAdApplicationID, desc.WinRTAdUnitID, desc.AdSize, desc.AdGravity, desc.UseAds);
                Shown();
            }

            Window.Current.Activate();
            running = true;
        }
		public void SetWindow(CoreWindow window)
		{
			if (CoreWindow != window) window.VisibilityChanged += visibilityChanged;

			CoreWindow = window;
			if (coreMetroWindow != null) coreMetroWindow.Dispose();
			coreMetroWindow = new CoreMetroWindow(this, window, theEvent, true);
		}
Exemplo n.º 3
0
        public void SetWindow(CoreWindow window)
        {
            if (CoreWindow != window)
            {
                window.VisibilityChanged += visibilityChanged;
            }

            CoreWindow = window;
            if (coreMetroWindow != null)
            {
                coreMetroWindow.Dispose();
            }
            coreMetroWindow = new CoreMetroWindow(this, window, theEvent, true);
        }