private void Dialog_Loaded(object sender, RoutedEventArgs e) { PART_TextBox.SelectAll(); switch (DialogSettings.ColorScheme) { case MetroDialogColorScheme.Accented: PART_NegativeButton.Style = FindResource("HighlightedSquareButtonStyle") as Style; PART_TextBox.SetResourceReference(ForegroundProperty, "BlackColorBrush"); break; } }
private void PartTextBoxOnTextChanged(object sender, TextChangedEventArgs e) { this.PART_TextBox.TextChanged -= PartTextBoxOnTextChanged; //if (Application.Current.MainWindow.IsActive) { PART_TextBox.Focus(); PART_TextBox.SelectAll(); // //PART_TextBox.RaiseEvent(new KeyboardFocusChangedEventArgs(Keyboard.PrimaryDevice, 0, null, PART_TextBox) { RoutedEvent = Keyboard.GotKeyboardFocusEvent, Source = PART_TextBox }); } }
private void OnTextBoxGotKeyBoardFocus(object sender, RoutedEventArgs e) { PART_TextBox.SelectAll(); }