Browse Source

WPF Designer: Fixed "Cannot undo when item is moved inside outline view" (http://community.sharpdevelop.net/forums/t/13247.aspx)

4.1
Daniel Grunwald 14 years ago
parent
commit
c67e7b2394
  1. 11
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNode.cs

11
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNode.cs

@ -142,10 +142,15 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView @@ -142,10 +142,15 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView
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;
}

Loading…
Cancel
Save