private void BtnClose_OnClick(object sender, RoutedEventArgs e) { var view = new SignOutDialog() { DataContext = new SignOutDialogVM() }; var result = DialogHostEx.ShowDialog(this, view, MainLoginClosingEventHandler); }
private void MainLogin_Closing(object sender, CancelEventArgs e) { e.Cancel = true; //let's set up a little MVVM, cos that's what the cool kids are doing: var view = new SignOutDialog() { DataContext = new SignOutDialogVM() }; var result = DialogHostEx.ShowDialog(this, view, MainLoginClosingEventHandler); }
private void ExecuteRunExtendedDialog(object o) { //let's set up a little MVVM, cos that's what the cool kids are doing: var view = new SignOutDialog() { DataContext = new SignOutDialogVM() }; //show the dialog DialogHost.Show(view, o, ExtendedOpenedEventHandler, ExtendedClosingEventHandler); //check the result... //Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL")); }
private async void WindowClosing(object obj) { //let's set up a little MVVM, cos that's what the cool kids are doing: var view = new SignOutDialog() { DataContext = new SignOutDialogVM() }; //show the dialog await DialogHost.Show(view, (object)"MainDialog", WindowClosingEventHandler, WindowClosingEventHandler); //check the result... //Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL")); }