private static void OnSecurityIDChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (e.NewValue != null && d is TextBoxEx) { TextBoxEx textBoxEx = d as TextBoxEx; textBoxEx.Text = textBoxEx.SecurityId; } }
private static void OnSelectOnEntryChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if ((bool)e.NewValue && d is TextBoxEx) { TextBoxEx textBoxEx = d as TextBoxEx; textBoxEx.GotFocus += (first, second) => { TextBoxEx textbE = first as TextBoxEx; if (textbE != null) { textbE.SelectionStart = 1; textbE.SelectionLength = textbE.Text.Length - 1; } }; } }