private async void WebAccountProviderCommandInvoked(WebAccountProviderCommand command) { // Show UI for signing in in the background in case of a slow connection and hide the sign in button LoadingHeader.Text = "Signing in.."; Loading_PR.IsActive = true; GetStarted_sp.Visibility = Visibility.Collapsed; Loading_SP.Visibility = Visibility.Visible; user = await MicrosoftAccount.SignIn(command.WebAccountProvider); if (user != null) { Loading_SP.Visibility = Visibility.Collapsed; GetStarted_sp.Visibility = Visibility.Collapsed; OutputPanel.Visibility = Visibility.Visible; ResultsText.Text = "Hi " + user.AccountName + "!"; ProfileImage.Fill = user.Image; Loading_PR.IsActive = false; } else { Loading_PR.IsActive = false; Loading_SP.Visibility = Visibility.Collapsed; GetStarted_sp.Visibility = Visibility.Visible; } }
private async void Page_Loaded(object sender, RoutedEventArgs e) { var device = AnalyticsInfo.VersionInfo.DeviceFamily; if (device == "Windows.Desktop" || device == "Windows.Tablet") { AppTitleBar.Visibility = Visibility.Visible; // Hide default title bar. var coreTitleBar = CoreApplication.GetCurrentView().TitleBar; coreTitleBar.ExtendViewIntoTitleBar = true; var applicationView = ApplicationView.GetForCurrentView(); var titleBar = applicationView.TitleBar; titleBar.ButtonBackgroundColor = Colors.Transparent; } AccountsSettingsPane.GetForCurrentView().AccountCommandsRequested += OnAccountCommandsRequested; user = await MicrosoftAccount.SignIn(); AccountName.Text = user.AccountName; AccountImage.Fill = user.Image; SignInListViewItem.Visibility = Visibility.Collapsed; AccountListViewItem.Visibility = Visibility.Visible; }