Exemple #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);
 }
Exemple #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);
        }
Exemple #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);
 }