public MainPage()
        {
            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Required;

            _mainViewModel = _mainViewModel ?? new MainViewModel();
            DataContext    = this;

            WatConfig.LoadConfigAsync(this.MainWebView, this.BottomCommandBar);

            this.MainWebView.NavigationCompleted += OnFirstLoadNavigationCompleted;

            // Listen for window resize events to reposition the extended splash screen image accordingly.
            // This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
            Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);

            splash = App.CurrentSplashScreen;
            if (splash != null)
            {
                // Retrieve the window coordinates of the splash screen image.
                splashImageRect = splash.ImageLocation;
                PositionImage();

                // Optional: Add a progress ring to your splash screen to show users that content is loading
                PositionRing();
            }

            if (!registered)
            {
                registered = true;
                MainWebView.ScriptNotify += MainWebView_ScriptNotify;
            }
        }
Exemplo n.º 2
0
        public MainPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Required;

            _mainViewModel = _mainViewModel ?? new MainViewModel();
            DataContext    = this;
            ApplicationView.GetForCurrentView().
            SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible);

            var splash = App.CurrentSplashScreen;

            if (splash != null)
            {
                // Optional: Add a progress ring to your splash screen to show users that content is loading
                PositionRing();
            }

            WatConfig.LoadConfigAsync(this.MainWebView, this.BottomCommandBar);
            this.MainWebView.NavigationCompleted += OnFirstLoadNavigationCompleted;
            HardwareButtons.BackPressed          += OnBackPressed;

            if (!registered)
            {
                registered = true;
                MainWebView.ScriptNotify += MainWebView_ScriptNotify;
            }
        }