private async void ClosingWindows(object o) { var view = new SampleDialog { Message = { Text = "È·¶¨¹Ø±Õ³ÌÐò£¿" } }; await DialogHost.Show(view, "RootDialog", ExtendedOpenedEventHandler, ExtendedClosingEventHandler); }
private async void OnClick_ShowPageDialogAsync(object sender, RoutedEventArgs e) { var view = new SampleDialog { DataContext = new SampleDialogViewModel() }; await DialogHost.Show(view, "DashboardPageDialog", ExtendedOpenedEventHandler, ExtendedClosingEventHandler); }
private async void ExecuteRunDialog(object o) { //let's set up a little MVVM, cos that's what the cool kids are doing: var view = new SampleDialog { DataContext = new LoginViewModel() }; //show the dialog var result = await DialogHost.Show(view, "RootDialog", ClosingEventHandler); //check the result... Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL")); }
// Display the close dialog for KeyUp. private void graphicsButton1_KeyUp(object sender, KeyEventArgs e) { SampleDialog form = new SampleDialog(); if (form.ShowDialog() == DialogResult.OK) { exporterHost.HWScanButton_Pressed -= hw_sbp; this.DialogResult = DialogResult.OK; this.Close(); } }