Exemple #1
0
        private async void LoadDataAsync(IActivatedEventArgs e)
        {
            var activationInfo = ActivationService.GetActivationInfo(e);

            await Startup.ConfigureAsync();

            var shellArgs = new ShellArgs
            {
                ViewModel = activationInfo.EntryViewModel,
                Parameter = activationInfo.EntryArgs,
                UserInfo  = await TryGetUserInfoAsync(e as IActivatedEventArgsWithUser)
            };

#if SKIP_LOGIN
            rootFrame.Navigate(typeof(MainShellView), shellArgs);
            var loginService = ServiceLocator.Current.GetService <ILoginService>();
            loginService.IsAuthenticated = true;
#else
            rootFrame.Navigate(typeof(LoginView), shellArgs);
#endif

            Window.Current.Content = rootFrame;

            Window.Current.Activate();
        }
Exemple #2
0
        private async Task ActivateAsync(IActivatedEventArgs e)
        {
            var activationInfo = ActivationService.GetActivationInfo(e);

            var frame = Window.Current.Content as Frame;

            if (frame == null)
            {
                await Startup.ConfigureAsync();

                frame = new Frame();
                Window.Current.Content = frame;
                var shellArgs = new ShellArgs
                {
                    ViewModel = activationInfo.EntryViewModel,
                    Parameter = activationInfo.EntryArgs,
                    UserInfo  = await TryGetUserInfoAsync(e as IActivatedEventArgsWithUser)
                };
#if SKIP_LOGIN
                frame.Navigate(typeof(MainShellView), shellArgs);
                var loginService = ServiceLocator.Current.GetService <ILoginService>();
                loginService.IsAuthenticated = true;
#else
                frame.Navigate(typeof(LoginView), shellArgs);
#endif
                Window.Current.Activate();
            }
            else
            {
                var navigationService = ServiceLocator.Current.GetService <INavigationService>();
                await navigationService.CreateNewViewAsync(activationInfo.EntryViewModel, activationInfo.EntryArgs);
            }
        }
        private async void LoadDataAsync(IActivatedEventArgs e)
        {
            var activationInfo = ActivationService.GetActivationInfo(e);

            await Startup.ConfigureAsync();

            var shellArgs = new ShellArgs
            {
                ViewModel = activationInfo.EntryViewModel,
                Parameter = activationInfo.EntryArgs,
                UserInfo  = await TryGetUserInfoAsync(e as IActivatedEventArgsWithUser)
            };

            rootFrame.Navigate(typeof(LoginView), shellArgs);
            Window.Current.Content = rootFrame;
            Window.Current.Activate();
        }
Exemple #4
0
        private async Task ActivateAsync(IActivatedEventArgs e)
        {
            var activationInfo = ActivationService.GetActivationInfo(e);

            var frame = Window.Current.Content as Frame;

            if (frame == null)
            {
                bool           loadState      = (e.PreviousExecutionState == ApplicationExecutionState.Terminated);
                ExtendedSplash extendedSplash = new ExtendedSplash(e, loadState);
                Window.Current.Content = extendedSplash;
                Window.Current.Activate();
            }
            else
            {
                var navigationService = ServiceLocator.Current.GetService <INavigationService>();
                await navigationService.CreateNewViewAsync(activationInfo.EntryViewModel, activationInfo.EntryArgs);
            }
        }