private async void loginClick(object sender, RoutedEventArgs e) { await Office365Helper.ClearSession(); UserProfile userProfile = await UserProfileInfo.GetUserProfileRequest(); if (userProfile == null) { return; } DisplayName.DataContext = userProfile.DisplayName; Mail.DataContext = userProfile.EMail; CalendarTitle.DataContext = this.CalendarTitleString; loginButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed; logoutButton.Visibility = Windows.UI.Xaml.Visibility.Visible; addCalButton.Visibility = Windows.UI.Xaml.Visibility.Visible; removeCalButton.Visibility = Windows.UI.Xaml.Visibility.Visible; refreshButton.Visibility = Windows.UI.Xaml.Visibility.Visible; sendMailButton.Visibility = Windows.UI.Xaml.Visibility.Visible; SessionListView.Visibility = Windows.UI.Xaml.Visibility.Visible; EventsListView.Visibility = Windows.UI.Xaml.Visibility.Visible; GetSessionList(); }
private async void SignoutButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { // TODO: When incorporating the sample code into your app, you will want to include the // "Office365Helper.ClearSession()" call as part of your application's regular // sign-out routine, rather than a separate button on each page. await Office365Helper.ClearSession(); this.DefaultViewModel["Items"] = null; }
private async void logoutClick(object sender, RoutedEventArgs e) { DisplayName.DataContext = ""; Mail.DataContext = ""; CalendarTitle.DataContext = this.CalendarTitleString; loginButton.Visibility = Windows.UI.Xaml.Visibility.Visible; logoutButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed; addCalButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed; removeCalButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed; refreshButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed; sendMailButton.Visibility = Windows.UI.Xaml.Visibility.Collapsed; SessionListView.Visibility = Windows.UI.Xaml.Visibility.Collapsed; EventsListView.Visibility = Windows.UI.Xaml.Visibility.Collapsed; await Office365Helper.ClearSession(); }