コード例 #1
0
        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();
                }
            }
        }
コード例 #2
0
ファイル: TreeHelper.cs プロジェクト: quietsy/TeamNotifier
 public static bool IsDescendantOf(DependencyObject element, DependencyObject parent)
 {
     return(TreeHelper.IsDescendantOf(element, parent, true));
 }