From 5a599d21e9d4b5a80daf58a8a4ab9f37c4d30c9a Mon Sep 17 00:00:00 2001 From: gumme Date: Tue, 1 Jul 2014 11:51:29 +0200 Subject: [PATCH] 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. --- .../WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs index 7f414eb460..e50b2798c2 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Xaml/XamlEditOperations.cs @@ -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; }