public static SIEEOkCancelDialog CreateOkCancelDialog( string title, System.Windows.Controls.UserControl content, SIEEViewModel vm, string leftButtonText = "Ok", string rightButtonText = "Cancel") { SIEEOkCancelDialog dlg = new SIEEOkCancelDialog(); SIEEOKCancelDialogViewModel dlgViewModel = new SIEEOKCancelDialogViewModel(); dlgViewModel.Title = title; dlgViewModel.LeftButtonText = leftButtonText; dlgViewModel.RightButtonText = rightButtonText; dlg.DataContext = dlgViewModel; content.DataContext = vm; dlgViewModel.Content = vm; dlg.AddContent(content); dlg.ShowInTaskbar = false; if (System.Windows.Application.Current == null) { dlg.Topmost = true; } else { dlg.Owner = System.Windows.Application.Current.MainWindow; } return(dlg); }
public static bool LaunchOkCancelDialog( string title, System.Windows.Controls.UserControl content, SIEEViewModel vm, string leftButtonText = "Ok", string rightButtonText = "Cancel") { SIEEOkCancelDialog dlg = CreateOkCancelDialog(title, content, vm, leftButtonText, rightButtonText); return(dlg.ShowDialog() == true); }