private void btnOkCancel_Click(object sender, RoutedEventArgs e) { MessageBoxOkCancel messageBoxOkCancel = new MessageBoxOkCancel("Test OK & Cancel", "This is Ok & Cancel Test .....", 200, 500, @"/Images/MessageBoxIcons/Information.png", @"/Images/MessageBoxIcons/Information.png"); messageBoxOkCancel.Owner = this; messageBoxOkCancel.ShowDialog(); if (messageBoxOkCancel.DialogResultRetern) { MessageBox.Show("True"); } else { MessageBox.Show("False"); } }
public void Execute(object parameter) { var deployConfirm = new MessageBoxOkCancel(_xamlAsiLoaderDialogTitle.Get(), _xamlAsiLoaderDialogDescription.Get()); if (deployConfirm.ShowDialog() == true) { Deployer.DeployAsiLoader(out string loaderPath, out string bootstrapperPath); string deployedBootstrapper = $"{_xamlAsiLoaderDialogBootstrapperDeployed.Get()} {bootstrapperPath}"; if (loaderPath == null) { // Installed Bootstrapper but not loader. var box = new MessageBox(_xamlAsiLoaderDialogTitle.Get(), deployedBootstrapper); box.ShowDialog(); } else { string deployedLoader = $"{_xamlAsiLoaderDialogLoaderDeployed.Get()} {loaderPath}"; var box = new MessageBox(_xamlAsiLoaderDialogTitle.Get(), $"{deployedLoader}\n{deployedBootstrapper}"); box.ShowDialog(); } } }