Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        private void ShowDialog(TaskDialog taskDialog)
        {
            taskDialog.Owner = this;

            if (ShowInline.IsChecked == true)
            {
                options.IsEnabled = false;
                taskDialog.ShowInline(this);
                options.IsEnabled = true;
            }
            else
            {
                taskDialog.Show();
            }
        }