Exemplo n.º 1
0
        private async Task NavView_Navigate(NavigationViewItem item)
        {
            try
            {
                UserExtensionHelper.PickupWhereYouLeft(item.Tag.ToString());
                switch (item.Tag)
                {
                case "LogIn":
                    await LoginUser();

                    break;

                case "LogOut":
                    AuthenticationHelper.SignOut();
                    login.Visibility           = Visibility.Visible;
                    logout.Visibility          = Visibility.Collapsed;
                    RecentFiles.Visibility     = Visibility.Collapsed;
                    UploadFile.Visibility      = Visibility.Collapsed;
                    DownloadFile.Visibility    = Visibility.Collapsed;
                    ContentFile.Visibility     = Visibility.Collapsed;
                    OutlookContacts.Visibility = Visibility.Collapsed;
                    ScheduleEvent.Visibility   = Visibility.Collapsed;
                    UserExtension.Visibility   = Visibility.Collapsed;
                    SaveAppData.Visibility     = Visibility.Collapsed;
                    Activity.Visibility        = Visibility.Collapsed;
                    break;

                case "RecentFiles":
                    ContentFrame.Navigate(typeof(RecentOneDriveFiles));
                    break;

                case "UploadFile":
                    ContentFrame.Navigate(typeof(UploadFileToOneDrive));
                    break;

                case "DownloadFile":
                    ContentFrame.Navigate(typeof(DownloadOneDriveFile));
                    break;

                case "ContentFile":
                    ContentFrame.Navigate(typeof(ContentFileOneDrive));
                    break;

                case "OutlookContacts":
                    ContentFrame.Navigate(typeof(OutlookContacts));
                    break;

                case "ScheduleEvent":
                    ContentFrame.Navigate(typeof(ScheduleEventOutlook));
                    break;

                case "UserExtension":
                    ContentFrame.Navigate(typeof(UserExtension));
                    break;

                case "SaveAppData":
                    ContentFrame.Navigate(typeof(SaveAppData));
                    break;

                case "Activity":
                    ContentFrame.Navigate(typeof(ActivityGraph));
                    break;
                }
            }
            catch (Exception ex)
            {
                NavView.Header = $"And error ocurred: {ex}";
            }
        }