public void DeepCopy(IDeepCopyable source, ICopyManager copyManager)
        {
            DetachFromObject();
            FocusSelectedItemAction f = (FocusSelectedItemAction)source;

            AttachToObject(copyManager.GetCopy(f._targetObject));
        }
Beispiel #2
0
 private static void OnFocusCurrentItemChanged(DependencyObject targetObject, bool focusCurrentItem)
 {
     if (focusCurrentItem)
     {
         if (GetFocusSelectedItemAction(targetObject) != null)
         {
             return;
         }
         FocusSelectedItemAction action = new FocusSelectedItemAction();
         SetFocusSelectedItemAction(targetObject, action);
         action.AttachToObject(targetObject as ItemsControl);
     }
     else
     {
         FocusSelectedItemAction action = GetFocusSelectedItemAction(targetObject);
         if (action != null)
         {
             action.DetachFromObject();
             RemoveFocusSelectedItemAction(targetObject);
         }
     }
 }
Beispiel #3
0
 protected static void SetFocusSelectedItemAction(DependencyObject targetObject, FocusSelectedItemAction value)
 {
     targetObject.SetAttachedPropertyValue(FOCUS_SELECTED_ITEM_ACTION_ATTACHED_PROPERTY, value);
 }