// private TextBox Directory; // private TextBox PriorityTextBox; public AddProgramSource(PluginInitContext context, Settings settings) { InitializeComponent(); _context = context; _settings = settings; DirectoryTextBox.Focus(); }
public Edit(Output output) { InitializeComponent(); foreach (string fileNameReplacement in AttributeHelper.GetAttributeReplacements()) { MenuItem item = new MenuItem(); item.Header = new TextBlock() { Text = fileNameReplacement }; item.Tag = fileNameReplacement; item.Click += FileNameReplacementItem_Click; FileNameReplacementList.Items.Add(item); } NameTextBox.Text = output.Name; DirectoryTextBox.Text = output.Directory; FileNameTextBox.Text = output.FileName; FileFormatComboBox.ItemsSource = FileHelper.GetFileFormats(); FileFormatComboBox.SelectedValue = output.FileFormatID; SaveAutomaticallyCheckBox.IsChecked = output.SaveAutomatically; NameTextBox.TextChanged += ValidateData; FileFormatComboBox.SelectionChanged += ValidateData; ValidateData(null, null); DirectoryTextBox.Focus(); }
private void ShowDirectoryTextBox() { ButtonGrid.Visibility = Visibility.Collapsed; DirectoryTextBoxMenu.Visibility = Visibility.Visible; DirectoryTextBox.SelectAll(); DirectoryTextBox.Focus(); DirectoryTextBoxMenuItem.IsSubmenuOpen = false; }
private void _viewModel_FocusAddressTextBoxRequested(object sender, EventArgs e) { if (DirectoryTextBoxMenu.Visibility == Visibility.Hidden) { ShowDirectoryTextBox(); } else { DirectoryTextBox.Focus(); string text = DirectoryTextBox.Text; if (!string.IsNullOrEmpty(text)) { DirectoryTextBox.SelectionStart = text.Length; } } }