Xceed.Wpf.Toolkit.AutoSelectTextBox.OnPreviewGotKeyboardFocus C# (CSharp) Method

OnPreviewGotKeyboardFocus() protected method

protected OnPreviewGotKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void
e System.Windows.Input.KeyboardFocusChangedEventArgs
return void
    protected override void OnPreviewGotKeyboardFocus( KeyboardFocusChangedEventArgs e )
    {
      base.OnPreviewGotKeyboardFocus( e );

      if( this.AutoSelectBehavior == AutoSelectBehavior.OnFocus )
      {
        // If the focus was not in one of our child ( or popup ), we select all the text.
        if( !TreeHelper.IsDescendantOf( e.OldFocus as DependencyObject, this ) )
        {
          this.SelectAll();
        }
      }
    }