Browse Source

Added check if parent view is ContentControl to avoid exception when pasting on for example a Border, that have a content property but is not a ContentControl.

pull/507/head
gumme 11 years ago
parent
commit
5a599d21e9
  1. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs

@ -131,7 +131,7 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml @@ -131,7 +131,7 @@ namespace ICSharpCode.WpfDesign.Designer.Xaml
AddInParent(parent, pastedItems);
pasted = true;
}
} else if (pastedItems.Count == 1 && parent.ContentProperty.Value == null && parent.ContentProperty.ValueOnInstance == null && DefaultPlacementBehavior.CanContentControlAdd((ContentControl)parent.View)) {
} else if (pastedItems.Count == 1 && parent.ContentProperty.Value == null && parent.ContentProperty.ValueOnInstance == null && parent.View is ContentControl && DefaultPlacementBehavior.CanContentControlAdd((ContentControl)parent.View)) {
AddInParent(parent, pastedItems);
pasted = true;
}

Loading…
Cancel
Save