Example #1
0
        private void FadeOutCompleted(object sender, EventArgs e)
        {
            (sender as AnimationClock).Completed -= FadeOutCompleted;

            _allowDirectNavigation = true;
            this.IsHitTestVisible  = true;

            SplashPage.NavigationService.Navigate(_navArgs.Content);

            SplashPage.Dispatcher.BeginInvoke(DispatcherPriority.Loaded,
                                              (ThreadStart) delegate()
            {
                DoubleAnimation da = new DoubleAnimation(1.0d, new Duration(TimeSpan.FromMilliseconds(200)));
                SplashPage.BeginAnimation(OpacityProperty, da);
            });
        }
        public App()
        {
            var splash = new SplashPage();

            this.MainPage = new NavigationPage(splash);

            var mainMenuViewModel = new MainMenuViewModel(this.MainPage.Navigation, new InventoryClient(AppConfig.CreateFromConfigFile().ApiUri));
            var mainMenuPage      = new MainMenuPage(mainMenuViewModel);

            this.initializeViewModels = async() => await mainMenuViewModel.InitializeAsync();

            this.beginAnimations = async() => await splash.BeginAnimation();

            this.navigateToMainMenu = async() =>
            {
                var navigating = this.MainPage.Navigation.PushAsync(mainMenuPage, true);
                this.MainPage.Navigation.RemovePage(splash);
                await navigating;
            };
        }