private void OnReadInput() { var textBox = new TextBox(); var dialog = new TaskDialog { Header = "Console Input", Content = textBox, Background = Brushes.White, }; textBox.Loaded += (o, e) => textBox.Focus(); textBox.KeyDown += (o, e) => { if (e.Key == Key.Enter) { TaskDialog.CancelCommand.Execute(null, dialog); } }; dialog.ShowInline(this); _viewModel.SendInput(textBox.Text); }
private void ViewErrorDetails_OnClick(object sender, RoutedEventArgs e) { if (_viewModel.LastError == null) { return; } TaskDialog.ShowInline(this, "Unhandled Exception", _viewModel.LastError.ToAsyncString(), string.Empty, TaskDialogButtons.Close); }
private void ShowDialog(TaskDialog taskDialog) { taskDialog.Owner = this; if (ShowInline.IsChecked == true) { options.IsEnabled = false; taskDialog.ShowInline(this); options.IsEnabled = true; } else { taskDialog.Show(); } }