Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 5a599d2

Browse files
author
gumme
committed
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.
1 parent 72b0f87 commit 5a599d2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void Paste()
131131
AddInParent(parent, pastedItems);
132132
pasted = true;
133133
}
134-
} else if (pastedItems.Count == 1 && parent.ContentProperty.Value == null && parent.ContentProperty.ValueOnInstance == null && DefaultPlacementBehavior.CanContentControlAdd((ContentControl)parent.View)) {
134+
} else if (pastedItems.Count == 1 && parent.ContentProperty.Value == null && parent.ContentProperty.ValueOnInstance == null && parent.View is ContentControl && DefaultPlacementBehavior.CanContentControlAdd((ContentControl)parent.View)) {
135135
AddInParent(parent, pastedItems);
136136
pasted = true;
137137
}

0 commit comments

Comments
 (0)