本文整理汇总了C#中ContentDialogButtonClickEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ContentDialogButtonClickEventArgs类的具体用法?C# ContentDialogButtonClickEventArgs怎么用?C# ContentDialogButtonClickEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentDialogButtonClickEventArgs类属于命名空间,在下文中一共展示了ContentDialogButtonClickEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CancelButtonClick
private void CancelButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
#if DEBUG
System.Diagnostics.Debug.WriteLine("CancelButton");
#endif
Application.Current.Exit();
}
示例2: Tela_PrimaryButtonClick
private async static void Tela_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
var tela = sender.Content as MyUserControl1;
var readDataa = await ReadWrite.readStringFromLocalFile("data");
Profile profile = JsonSerilizer.ToProfile(readDataa);
if (tela.passwordBoxSenha.Password == profile.Password)
{
}
else
{
var acessar = new MyUserControl1();
ContentDialog dialogo = new ContentDialog();
dialogo.PrimaryButtonText = "Войти";
dialogo.PrimaryButtonClick += Tela_PrimaryButtonClick;
dialogo.Content = acessar;
await dialogo.ShowAsync();
}
}
示例3: ContentDialog_PrimaryButtonClick
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
// Disable the primary button
IsPrimaryButtonEnabled = false;
// Force the dialog to stay open until the operation completes.
// We will call Hide() when the api calls are done.
args.Cancel = true;
try
{
// Change the passphrase
await KryptPadApi.ChangePassphraseAsync(OldPassphrase, NewPassphrase);
// Done
await DialogHelper.ShowMessageDialogAsync("Profile passphrase changed successfully.");
// Hide dialog
Hide();
}
catch (WarningException ex)
{
// Operation failed
await DialogHelper.ShowMessageDialogAsync(ex.Message);
}
catch (WebException ex)
{
// Operation failed
await DialogHelper.ShowMessageDialogAsync(ex.Message);
}
// Restore the button
IsPrimaryButtonEnabled = CanChangePassphrase;
}
示例4: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
try
{
selection = int.Parse(number.Text);
if (selection > 0 && selection <= MainPage.newestComic)
canClose = true;
else
throw new OverflowException();
}
catch (ArgumentNullException)
{
errorText.Text = "Please enter a number between 1 and " + MainPage.newestComic;
canClose = false;
}
catch (FormatException)
{
errorText.Text = "Please enter a number between 1 and " + MainPage.newestComic;
canClose = false;
}
catch (OverflowException)
{
errorText.Text = "Please enter a number between 1 and " + MainPage.newestComic;
canClose = false;
}
}
示例5: ContentDialog_PrimaryButtonClick
//Sign in button
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
// Ensure the user name and password fields aren't empty. If a required field
// is empty, set args.Cancel = true to keep the dialog open.
if (string.IsNullOrEmpty(userNameTextBox.Text))
{
args.Cancel = true;
errorTextBlock.Text = "User name is required.";
}
else if (string.IsNullOrEmpty(passwordTextBox.Password))
{
args.Cancel = true;
errorTextBlock.Text = "Password is required.";
}
// If you're performing async operations in the button click handler,
// get a deferral before you await the operation. Then, complete the
// deferral when the async operation is complete.
ContentDialogButtonClickDeferral deferral = args.GetDeferral();
//if (await SomeAsyncSignInOperation())
//{
this.Result = SignInResult.SignInOK;
//}
//else
//{
// this.Result = SignInResult.SignInFail;
//}
deferral.Complete();
}
示例6: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
if(Windows.Storage.ApplicationData.Current.LocalSettings.Values.Any(m => m.Key.Equals("username")))
Windows.Storage.ApplicationData.Current.LocalSettings.Values.Remove("username");
Windows.Storage.ApplicationData.Current.LocalSettings.Values.Add(new KeyValuePair<string, object>("username", this.name.Text));
this.Username = this.name.Text;
}
示例7: ContentDialog_PrimaryButtonClick
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
// Ensure the user name and password fields aren't empty. If a required field
// is empty, set args.Cancel = true to keep the dialog open.
if (string.IsNullOrEmpty(txtUsername.Text))
{
args.Cancel = true;
txtError.Text = "User name is required";
return;
}
else if (string.IsNullOrEmpty(txtPassword.Password))
{
args.Cancel = true;
txtError.Text = "Password is required";
return;
}
// If you're performing async operations in the button click handler,
// get a deferral before you await the operation. Then, complete the
// deferral when the async operation is complete.
ContentDialogButtonClickDeferral deferral = args.GetDeferral();
var rememberMe = chkRememberMe.IsChecked.Value;
if( !await dataAccess.Login(txtUsername.Text, txtPassword.Password, rememberMe) )
{
args.Cancel = true;
txtError.Text = "Login Failed";
}
deferral.Complete();
}
示例8: DeleteItemClicked
private void DeleteItemClicked(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
if (DeleteTodoItemClicked != null)
{
DeleteTodoItemClicked(this, (TodoItemViewModel)this.DataContext);
}
}
示例9: ContentDialog_PrimaryButtonClick
/// <summary>
/// 确定
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
args.Cancel = true;
UpLoading.Visibility = Visibility.Visible;
IsPrimaryButtonEnabled = false;
object[] result = await UserService.AddWZ(WZUrl.Text, WZTitle.Text, WZTags.Text, WZSummary.Text);
if (result != null)
{
if ((bool)result[0])
{
Hide();
}
else
{
Tips.Text = result[1].ToString();
UpLoading.Visibility = Visibility.Collapsed;
IsPrimaryButtonEnabled = true;
}
}
else
{
Tips.Text = "操作失败!";
UpLoading.Visibility = Visibility.Collapsed;
IsPrimaryButtonEnabled = true;
}
}
示例10: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
Dokument.statusBean = (Model.Status)statusi.SelectedItem;
Dokument.vrstaDokumenta = (Model.VrstaDokumenta)vrsteDokumenata.SelectedItem;
Dokument.kreiran = DateTime.Now;
Dokument.istice = istice.Date.Date;
}
示例11: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args )
{
args.Cancel = true;
DetectInputLogin();
Canceled = false;
}
示例12: HandleContentDialogPrimaryButtonClick
private void HandleContentDialogPrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
if ((deleteSong.IsChecked.HasValue && deleteSong.IsChecked.Value) &&
(deleteSongConfirm.IsChecked.HasValue && deleteSongConfirm.IsChecked.Value))
{
LibraryViewModel.Current.DeleteSong(Song);
}
else
{
Song.Name = editSongName.Text;
Song.ArtistName = editArtistName.Text;
string newAlbumName = editAlbumName.Text;
string newAlbumAristName = editAlbumAritstName.Text;
if (newAlbumName != Song.Album.Name || newAlbumAristName != Song.Album.ArtistName)
{
ArtistViewModel albumArtistViewModel = LibraryViewModel.Current.LookupArtistByName(newAlbumAristName);
AlbumViewModel newAlbumViewModel = LibraryViewModel.Current.LookupAlbumByName(newAlbumName, albumArtistViewModel.ArtistId);
Song.UpdateAlbum(newAlbumViewModel);
}
uint newTrackNumber;
if (uint.TryParse(editTrackNumber.Text, out newTrackNumber))
{
Song.TrackNumber = newTrackNumber;
}
}
}
示例13: ContentDialog_PrimaryButtonClick
private void ContentDialog_PrimaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args )
{
args.Cancel = true;
if ( Keys.SelectedItem == null )
{
StringResources stx = new StringResources();
ServerMessage.Text = "Please Select a key";
return;
}
string PubKey = RSA.SelectedItem.GenPublicKey();
string Remarks = RemarksInput.Text.Trim();
if ( string.IsNullOrEmpty( Remarks ) )
{
Remarks = RemarksPlaceholder;
}
RCache.POST(
Shared.ShRequest.Server
, Shared.ShRequest.PlaceRequest( Target, PubKey, BindItem.Id, Remarks )
, PlaceSuccess
, ( c, Id, ex ) => { Error( ex.Message ); }
, false
);
}
示例14: ContentDialog_SecondaryButtonClick
private void ContentDialog_SecondaryButtonClick( ContentDialog sender, ContentDialogButtonClickEventArgs args )
{
if ( Member.WillLogin || Member.IsLoggedIn )
{
args.Cancel = true;
}
}
示例15: Rate_Click
private static async void Rate_Click(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
//throw new NotImplementedException();
//if (ReadAppRatingSetting())
// return;
//OpenStoreRating();
await Launcher.LaunchUriAsync(new Uri(string.Format("ms-windows-store:REVIEW?PFN={0}", Windows.ApplicationModel.Package.Current.Id.FamilyName)));
}