Exemplo n.º 1
0
 public static void RegisterFocusEvents(DependencyObject obj)
 {
     if (AutomationPeerCache.GetIsAutomationFocused(obj))
     {
         return;
     }
     AutomationPeerCache.RegisterFocusEvents(obj, "IsKeyboardFocused");
 }
Exemplo n.º 2
0
 public static void RegisterFocusEvents(DependencyObject obj, AutomationPeer associatedPeer)
 {
     if (AutomationPeerCache.GetIsAutomationFocused(obj))
     {
         return;
     }
     if (AutomationPeerCache.GetAutomationPeer(obj) == null && UIElementAutomationPeer.FromElement(obj as UIElement) == null)
     {
         AutomationPeerCache.SetAutomationPeer(obj, associatedPeer);
     }
     AutomationPeerCache.RegisterFocusEvents(obj, "IsKeyboardFocused");
 }