Exemplo n.º 1
0
 private static void SetEventIfItsNotSet(DependencyObject obj)
 {
     if ((bool)obj.GetValue(IsEventSetProperty))
     {
         return;
     }
     FocusManager.AddLostFocusHandler(obj, (sender, e) =>
     {
         ((DependencyObject)sender).SetValue(HasFocusProperty, false);
     });
     obj.SetValue(IsEventSetProperty, true);
 }