public override Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            var shareArgs = args as ShareTargetActivatedEventArgs;

            if (shareArgs != null)
            {
                var key = nameof(ShareOperation);
                if (SessionState.ContainsKey(key))
                {
                    SessionState.Remove(key);
                }
                SessionState.Add(key, shareArgs.ShareOperation);

                var frame = new Frame();
                var nav   = NavigationServiceFactory(BackButton.Ignore, ExistingContent.Exclude, frame);
                Window.Current.Content = frame;
                nav.Navigate(typeof(Views.SharePage), key);
            }
            else
            {
                var nav = NavigationService ?? NavigationServiceFactory(BackButton.Attach, ExistingContent.Include);
                Window.Current.Content = nav.Frame;
                nav.Navigate(typeof(Views.MainPage));
            }
            return(Task.CompletedTask);
        }
        private void ExecuteLogin(User user)
        {
            SessionState.Add("User", user);
            User test = SessionState["User"] as User;

            Debug.WriteLine(test.Name);
            NavigationService.Navigate(typeof(Views.TasksPage), null);
        }
예제 #3
0
        public async void ClickCommand(object sender, object parameter)
        {
            var arg = parameter as Windows.UI.Xaml.Controls.ItemClickEventArgs;

            SelectedPost = arg.ClickedItem as Post;
            if (SessionState.ContainsKey("selectedPost"))
            {
                SessionState.Remove("selectedPost");
            }
            SessionState.Add("selectedPost", SelectedPost);
            NavigationService.Navigate(typeof(Views.DetailPage));
        }
예제 #4
0
        public override Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            var shareArgs = args as ShareTargetActivatedEventArgs;

            if (shareArgs != null)
            {
                var key = SessionState.Add(typeof(ShareOperation), string.Empty, shareArgs.ShareOperation);
                NavigationService.Navigate(typeof(Views.MainPage), key.Key);
            }
            else
            {
                NavigationService.Navigate(typeof(Views.MainPage));
            }
            return(Task.CompletedTask);
        }
예제 #5
0
        public override Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            if (args.Kind == ActivationKind.File)
            {
                var tmp = args as FileActivatedEventArgs;
                SessionState.Add("importFile", tmp);

                NavigationService.NavigateAsync(typeof(Views.ImportPage), "importFile");
            }
            else
            {
                NavigationService.NavigateAsync(typeof(Views.MainPage));
            }

            return(Task.CompletedTask);
        }
예제 #6
0
        public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
        {
            CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;

            //remove the solid-colored backgrounds behind the caption controls and system back button
            ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;

            titleBar.ButtonBackgroundColor         = Colors.Transparent;
            titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
            // TODO: add your long-running task here
            if (!SessionState.ContainsKey("State"))
            {
                SessionState.Add("State", new XWingSessionState(await XWingRepository.CreateXWingRepository()));
            }
            //await NavigationService.NavigateAsync(typeof(Views.Shell));
        }