|
|
@@ -171,6 +171,22 @@ namespace Avalonia.Controls.UnitTests.Presenters
|
|
|
Assert.Equal("foo", target.DataContext);
|
|
|
}
|
|
|
|
|
|
+ [Fact]
|
|
|
+ public void Assigning_Control_To_Content_After_NonControl_Should_Clear_DataContext()
|
|
|
+ {
|
|
|
+ var target = new ContentPresenter();
|
|
|
+
|
|
|
+ target.Content = "foo";
|
|
|
+ target.UpdateChild();
|
|
|
+
|
|
|
+ Assert.True(target.IsSet(Control.DataContextProperty));
|
|
|
+
|
|
|
+ target.Content = new Border();
|
|
|
+ target.UpdateChild();
|
|
|
+
|
|
|
+ Assert.False(target.IsSet(Control.DataContextProperty));
|
|
|
+ }
|
|
|
+
|
|
|
[Fact]
|
|
|
public void Tries_To_Recycle_DataTemplate()
|
|
|
{
|