diff --git a/samples/interop/WindowsInteropTest/EmbedToWinFormsDemo.Designer.cs b/samples/interop/WindowsInteropTest/EmbedToWinFormsDemo.Designer.cs index 1cd0de3041..b5dccffd4d 100644 --- a/samples/interop/WindowsInteropTest/EmbedToWinFormsDemo.Designer.cs +++ b/samples/interop/WindowsInteropTest/EmbedToWinFormsDemo.Designer.cs @@ -85,7 +85,7 @@ namespace WindowsInteropTest this.avaloniaHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.avaloniaHost.Child = null; + this.avaloniaHost.Content = null; this.avaloniaHost.Location = new System.Drawing.Point(6, 19); this.avaloniaHost.Name = "avaloniaHost"; this.avaloniaHost.Size = new System.Drawing.Size(489, 393); diff --git a/samples/interop/WindowsInteropTest/EmbedToWinFormsDemo.cs b/samples/interop/WindowsInteropTest/EmbedToWinFormsDemo.cs index 0f087da9a0..1aa271d9b1 100644 --- a/samples/interop/WindowsInteropTest/EmbedToWinFormsDemo.cs +++ b/samples/interop/WindowsInteropTest/EmbedToWinFormsDemo.cs @@ -17,10 +17,7 @@ namespace WindowsInteropTest public EmbedToWinFormsDemo() { InitializeComponent(); - var ctrl = new EmbeddableControl(); - ctrl.Content = new ControlCatalogControl(); - ctrl.ApplyTemplate(); - avaloniaHost.Child = ctrl; + avaloniaHost.Content = new ControlCatalogControl(); } } } diff --git a/samples/interop/WindowsInteropTest/EmbedToWpfDemo.xaml.cs b/samples/interop/WindowsInteropTest/EmbedToWpfDemo.xaml.cs index 75d6f4f5d2..2486bc932d 100644 --- a/samples/interop/WindowsInteropTest/EmbedToWpfDemo.xaml.cs +++ b/samples/interop/WindowsInteropTest/EmbedToWpfDemo.xaml.cs @@ -25,7 +25,7 @@ namespace WindowsInteropTest public EmbedToWpfDemo() { InitializeComponent(); - Host.Child = new EmbeddableControl {Content = new ControlCatalogControl()}; + Host.Content = new ControlCatalogControl(); } } } diff --git a/src/Avalonia.Controls/Avalonia.Controls.csproj b/src/Avalonia.Controls/Avalonia.Controls.csproj index 1fffa7ef57..925b38ec9d 100644 --- a/src/Avalonia.Controls/Avalonia.Controls.csproj +++ b/src/Avalonia.Controls/Avalonia.Controls.csproj @@ -56,7 +56,7 @@ - + diff --git a/src/Avalonia.Controls/EmbeddableControl.cs b/src/Avalonia.Controls/EmbeddableControlRoot.cs similarity index 83% rename from src/Avalonia.Controls/EmbeddableControl.cs rename to src/Avalonia.Controls/EmbeddableControlRoot.cs index 4221708bcb..8d3e0fc6e2 100644 --- a/src/Avalonia.Controls/EmbeddableControl.cs +++ b/src/Avalonia.Controls/EmbeddableControlRoot.cs @@ -11,9 +11,9 @@ using Avalonia.Styling; namespace Avalonia.Controls { - public class EmbeddableControl : TopLevel, IStyleable, IFocusScope, INameScope + public class EmbeddableControlRoot : TopLevel, IStyleable, IFocusScope, INameScope, IDisposable { - public EmbeddableControl() : base(PlatformManager.CreateEmbeddableWindow()) + public EmbeddableControlRoot() : base(PlatformManager.CreateEmbeddableWindow()) { PlatformImpl.Show(); } @@ -63,6 +63,10 @@ namespace Avalonia.Controls public void Unregister(string name) => _nameScope.Unregister(name); - Type IStyleable.StyleKey => typeof(EmbeddableControl); + Type IStyleable.StyleKey => typeof(EmbeddableControlRoot); + public void Dispose() + { + PlatformImpl.Dispose(); + } } } diff --git a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj index 93b258d3f1..76ed678350 100644 --- a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj +++ b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj @@ -209,7 +209,7 @@ - + Designer diff --git a/src/Avalonia.Themes.Default/DefaultTheme.xaml b/src/Avalonia.Themes.Default/DefaultTheme.xaml index 81d1ce12ca..cc8b6722ee 100644 --- a/src/Avalonia.Themes.Default/DefaultTheme.xaml +++ b/src/Avalonia.Themes.Default/DefaultTheme.xaml @@ -32,5 +32,5 @@ - + diff --git a/src/Avalonia.Themes.Default/EmbeddableControl.xaml b/src/Avalonia.Themes.Default/EmbeddableControlRoot.xaml similarity index 97% rename from src/Avalonia.Themes.Default/EmbeddableControl.xaml rename to src/Avalonia.Themes.Default/EmbeddableControlRoot.xaml index 6f9019f71f..edea0ddf64 100644 --- a/src/Avalonia.Themes.Default/EmbeddableControl.xaml +++ b/src/Avalonia.Themes.Default/EmbeddableControlRoot.xaml @@ -1,4 +1,4 @@ -