Skip to content
Browse files

WPF Designer: Fixed "Cannot undo when item is moved inside outline vi…

  • Loading branch information...
1 parent c1ba2b7 commit c67e7b239434fe06f51e09e63a79c83b38c7c31d @dgrunwald dgrunwald committed
View
11 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNode.cs
@@ -142,10 +142,15 @@ void UpdateChildrenCore(IEnumerable<DesignItem> items)
public bool CanInsert(IEnumerable<OutlineNode> nodes, OutlineNode after, bool copy)
{
- var operation = PlacementOperation.Start(nodes.Select(node => node.DesignItem).ToArray(), DummyPlacementType);
var placementBehavior = DesignItem.GetBehavior<IPlacementBehavior>();
- if(operation!=null)
- return placementBehavior.CanEnterContainer(operation);
+ if (placementBehavior == null)
+ return false;
+ var operation = PlacementOperation.Start(nodes.Select(node => node.DesignItem).ToArray(), DummyPlacementType);
+ if (operation != null) {
+ bool canEnter = placementBehavior.CanEnterContainer(operation);
+ operation.Abort();
+ return canEnter;
+ }
return false;
}

0 comments on commit c67e7b2

Please sign in to comment.
Something went wrong with that request. Please try again.