private async void ButtonShowContentDialog3_Click(object sender, RoutedEventArgs e) { var btn = sender as Button; var result = await MyContentDialog.ShowAsync(); btn.Content = "Result: " + result; }
private async Task ShowLoading() { MyContentDialog.ShowAsync(); await Task.Delay(2000); cdtb.Text = "登陆成功"; await Task.Delay(1000); MyContentDialog.Hide(); }
private async Task verify() { string info = null; var succeed = false; var result = await UserConsentVerifier.RequestVerificationAsync(Strings.Resources.Verify.Dialog.Content); switch (result) { case UserConsentVerificationResult.Verified: succeed = true; break; case UserConsentVerificationResult.DeviceNotPresent: info = Strings.Resources.Verify.DeviceNotPresent; break; case UserConsentVerificationResult.NotConfiguredForUser: info = Strings.Resources.Verify.NotConfigured; break; case UserConsentVerificationResult.DisabledByPolicy: info = Strings.Resources.Verify.Disabled; break; case UserConsentVerificationResult.DeviceBusy: info = Strings.Resources.Verify.DeviceBusy; break; case UserConsentVerificationResult.RetriesExhausted: info = Strings.Resources.Verify.RetriesExhausted; break; case UserConsentVerificationResult.Canceled: info = Strings.Resources.Verify.Canceled; break; default: info = Strings.Resources.Verify.OtherFailure; break; } if (!succeed) { if (info != null) { var dialog = new MyContentDialog { Title = Strings.Resources.Verify.FailedDialogTitle, Content = info, CloseButtonText = Strings.Resources.General.Exit, }; await dialog.ShowAsync(); } Application.Current.Exit(); } }
private async void AppBarButton_Click_3(object sender, RoutedEventArgs e) { var btn = sender as Button; var result = await MyContentDialog.ShowAsync(); }
private async void BackgroundList_ItemClick(Object sender, ItemClickEventArgs e) { await MyContentDialog.ShowAsync(); }