diff --git a/src/Avalonia.Themes.Default/DropDown.xaml b/src/Avalonia.Themes.Default/DropDown.xaml index c33e4af4f4..5a3d44360c 100644 --- a/src/Avalonia.Themes.Default/DropDown.xaml +++ b/src/Avalonia.Themes.Default/DropDown.xaml @@ -10,10 +10,10 @@ BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> - + { }; + + root.Child = null; + + Assert.False(((ILogical)target).IsAttachedToLogicalTree); + Assert.False(((ILogical)rectangle).IsAttachedToLogicalTree); + } + private FuncControlTemplate GetTemplate() { return new FuncControlTemplate(parent => @@ -26,8 +71,7 @@ namespace Avalonia.Controls.UnitTests { new ContentControl { - Name = "contentControl", - [~ContentPresenter.ContentProperty] = parent[~DropDown.SelectionBoxItemProperty], + [!ContentControl.ContentProperty] = parent[!DropDown.SelectionBoxItemProperty], }, new ToggleButton { @@ -35,7 +79,12 @@ namespace Avalonia.Controls.UnitTests }, new Popup { - Name = "popup", + Name = "PART_Popup", + Child = new ItemsPresenter + { + Name = "PART_ItemsPresenter", + [!ItemsPresenter.ItemsProperty] = parent[!DropDown.ItemsProperty], + } } } };