diff --git a/src/Addins/Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj b/src/Addins/Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj
index c8687a0168..f73e5cd28b 100755
--- a/src/Addins/Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj
+++ b/src/Addins/Eto.Addin.VisualStudio/Eto.Addin.VisualStudio.csproj
@@ -301,8 +301,8 @@
-
-
+
+
diff --git a/src/Addins/Eto.Designer/DesignPanel.cs b/src/Addins/Eto.Designer/DesignPanel.cs
index 63102d7465..8f42151e9a 100644
--- a/src/Addins/Eto.Designer/DesignPanel.cs
+++ b/src/Addins/Eto.Designer/DesignPanel.cs
@@ -91,11 +91,19 @@ public static Control GetContent(Control content)
void ControlCreatedInternal(Control control)
{
- ControlCreating?.Invoke();
- contentControl = control;
- designSurface.Content = GetContent(control);
- token = null;
- ControlCreated?.Invoke();
+ try
+ {
+ ControlCreating?.Invoke();
+ contentControl = control;
+ designSurface.Content = GetContent(control);
+ token = null;
+ ControlCreated?.Invoke();
+ }
+ catch (Exception ex)
+ {
+ designSurface.Content = null;
+ ErrorInternal(ex);
+ }
}
void ErrorInternal(Exception ex)
diff --git a/src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj b/src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj
index dc0d0bae19..2296884cac 100644
--- a/src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj
+++ b/src/Eto.Serialization.Xaml/Eto.Serialization.Xaml.csproj
@@ -29,7 +29,7 @@ https://github.com/picoe/Eto/wiki
-
+
diff --git a/src/Eto.Wpf/Eto.Wpf.csproj b/src/Eto.Wpf/Eto.Wpf.csproj
index 410f5473da..fb761b6e7d 100644
--- a/src/Eto.Wpf/Eto.Wpf.csproj
+++ b/src/Eto.Wpf/Eto.Wpf.csproj
@@ -149,7 +149,7 @@ You do not need to use any of the classes of this assembly (unless customizing t
-
+
diff --git a/src/Eto/Eto.csproj b/src/Eto/Eto.csproj
index 6c188d2f4c..be8154d907 100644
--- a/src/Eto/Eto.csproj
+++ b/src/Eto/Eto.csproj
@@ -40,7 +40,8 @@ https://github.com/picoe/Eto/wiki
-
+
+
@@ -49,6 +50,6 @@ https://github.com/picoe/Eto/wiki
-
+
\ No newline at end of file
diff --git a/src/Eto/Forms/Container.cs b/src/Eto/Forms/Container.cs
index 7c3288463a..376fa14688 100644
--- a/src/Eto/Forms/Container.cs
+++ b/src/Eto/Forms/Container.cs
@@ -361,6 +361,10 @@ protected void RemoveLogicalParent(Control child)
/// Previous child that the new child is replacing.
protected void SetParent(Control child, Action assign = null, Control previousChild = null)
{
+ if (ReferenceEquals(child, this))
+ {
+ throw new InvalidOperationException("Cannot assign a control as a child of itself.");
+ }
if (Handler is IThemedControlHandler)
{
if (!ReferenceEquals(previousChild, null))
@@ -374,7 +378,7 @@ protected void SetParent(Control child, Action assign = null, Control previousCh
{
#if DEBUG
if (!ReferenceEquals(previousChild.VisualParent, this))
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "The previous child control is not a child of this container. Ensure you only remove children that you own."));
+ throw new ArgumentException("The previous child control is not a child of this container. Ensure you only remove children that you own.");
#endif
if (!ReferenceEquals(previousChild.VisualParent, null))
diff --git a/test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj b/test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj
index a8606dbf04..afc9c8d3af 100644
--- a/test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj
+++ b/test/Eto.Test.Gtk/Eto.Test.Gtk2.csproj
@@ -44,7 +44,7 @@
-
+
\ No newline at end of file
diff --git a/test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj b/test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj
index 587ccbc07f..f8155ca810 100644
--- a/test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj
+++ b/test/Eto.Test.Gtk/Eto.Test.Gtk3.csproj
@@ -55,7 +55,7 @@
-
+
\ No newline at end of file
diff --git a/test/Eto.Test.Mac/Eto.Test.Mac64.csproj b/test/Eto.Test.Mac/Eto.Test.Mac64.csproj
index 473e2ebf4c..40bbc12a3a 100644
--- a/test/Eto.Test.Mac/Eto.Test.Mac64.csproj
+++ b/test/Eto.Test.Mac/Eto.Test.Mac64.csproj
@@ -1,8 +1,8 @@
-
+
-
+
@@ -24,13 +24,13 @@
-
+
-
+
diff --git a/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj b/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj
index ae81a9cdd9..576a007c8f 100644
--- a/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj
+++ b/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj
@@ -41,7 +41,7 @@
-
+
diff --git a/test/Eto.Test.WinForms/Eto.Test.WinForms.csproj b/test/Eto.Test.WinForms/Eto.Test.WinForms.csproj
index 3601343cff..489c2828fd 100644
--- a/test/Eto.Test.WinForms/Eto.Test.WinForms.csproj
+++ b/test/Eto.Test.WinForms/Eto.Test.WinForms.csproj
@@ -54,7 +54,7 @@
-
+
diff --git a/test/Eto.Test.Wpf/Eto.Test.Wpf.csproj b/test/Eto.Test.Wpf/Eto.Test.Wpf.csproj
index 2400b1e6cb..c899876308 100644
--- a/test/Eto.Test.Wpf/Eto.Test.Wpf.csproj
+++ b/test/Eto.Test.Wpf/Eto.Test.Wpf.csproj
@@ -62,7 +62,7 @@
-
+
diff --git a/test/Eto.Test/Eto.Test.csproj b/test/Eto.Test/Eto.Test.csproj
index 33c9c0ef6a..aaf8cb3339 100644
--- a/test/Eto.Test/Eto.Test.csproj
+++ b/test/Eto.Test/Eto.Test.csproj
@@ -30,10 +30,10 @@
-
+
-
+