コード例 #1
0
        public static UIElement ConvertPageToUIElement(this Page page, WpfApplicationPage applicationPage)
        {
            var application = new DefaultApplication();

            application.MainPage = page;
            var result = new Platform(applicationPage);

            result.SetPage(page);
            return(result.GetCanvas());
        }
コード例 #2
0
        //void OnActivated(object sender, ActivatedEventArgs e)
        //{
        //	// TODO : figure out consistency of get this to fire
        //	// Check whether tombstoned (terminated, but OS retains information about navigation state and state dictionarys) or dormant
        //	_application.SendResume();
        //}

        //// when app gets tombstoned, user press back past first page
        //void OnClosing(object sender, ClosingEventArgs e)
        //{
        //	// populate isolated storage.
        //	//SerializePropertyStore ();
        //	_application.SendSleepAsync().Wait();
        //}

        //void OnDeactivated(object sender, DeactivatedEventArgs e)
        //{
        //	// populate state dictionaries, properties
        //	//SerializePropertyStore ();
        //	_application.SendSleepAsync().Wait();
        //}

        //void OnLaunching(object sender, LaunchingEventArgs e)
        //{
        //	// TODO : not currently firing, is fired before MainPage ctor is called
        //	_application.SendStart();
        //}

        //void OnOrientationChanged(object sender, OrientationChangedEventArgs e)
        //{
        //	MessagingCenter.Send(this, Forms.WP8DeviceInfo.BWPorientationChangedName, e.Orientation.ToDeviceOrientation());
        //}

        void SetMainPage()
        {
            if (_platform == null)
            {
                _platform = new Platform(this);
            }

            _platform.SetPage(_application.MainPage);

            if (!ReferenceEquals(Content, _platform))
            {
                Content = _platform.GetCanvas();
            }
        }