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); }
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); }
/// <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); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> public static void BeginEdit(this DependencyObject obj) { TreeViewInPlaceEditBehavior.SetIsEditing(obj, true); }