Beispiel #1
0
 public static void BeginEdit(this DependencyObject item)
 {
     // Resetting the property values otherwise PropertyChangedCallback will not be called correctly.
     TreeViewInPlaceEditBehavior.SetIsEditCanceled(item, false);
     TreeViewInPlaceEditBehavior.SetIsEditConfirmed(item, false);
     TreeViewInPlaceEditBehavior.SetIsEditing(item, true);
 }
Beispiel #2
0
        public static void EndEdit(this DependencyObject item, bool cancel)
        {
            if (!item.IsEditing())
            {
                return;
            }

            TreeViewInPlaceEditBehavior.SetIsEditCanceled(item, cancel);
            TreeViewInPlaceEditBehavior.SetIsEditConfirmed(item, !cancel);
            TreeViewInPlaceEditBehavior.SetIsEditing(item, false);
        }
Beispiel #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="cancel"></param>
 /// <returns></returns>
 public static void EndEdit(this DependencyObject obj, bool cancel = true)
 {
     TreeViewInPlaceEditBehavior.SetIsEditCancelled(obj, cancel);
     TreeViewInPlaceEditBehavior.SetIsEditConfirmed(obj, !cancel);
     TreeViewInPlaceEditBehavior.SetIsEditing(obj, false);
 }
Beispiel #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static void BeginEdit(this DependencyObject obj)
 {
     TreeViewInPlaceEditBehavior.SetIsEditing(obj, true);
 }
Beispiel #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static bool IsEditing(this DependencyObject obj)
 {
     return(TreeViewInPlaceEditBehavior.GetIsEditing(obj));
 }