Browse Source

Don't add Panel Logical children twice!

pull/72/merge
Steven Kirk 11 years ago
parent
commit
4e5cee4378
  1. 1
      Perspex.Controls/Panel.cs
  2. 12
      Tests/Perspex.Controls.UnitTests/PanelTests.cs

1
Perspex.Controls/Panel.cs

@ -57,7 +57,6 @@ namespace Perspex.Controls
this.ClearVisualChildren();
this.children.Clear();
this.children.AddRange(value);
this.LogicalChildren.AddRange(value);
}
}

12
Tests/Perspex.Controls.UnitTests/PanelTests.cs

@ -84,6 +84,18 @@ namespace Perspex.Controls.UnitTests
Assert.Null(child2.GetLogicalParent());
}
[Fact]
public void Setting_Children_Should_Make_Controls_Appear_In_Panel_Children()
{
var panel = new Panel();
var child = new Control();
panel.Children = new Controls { child };
Assert.Equal(new[] { child }, panel.Children);
Assert.Equal(new[] { child }, panel.GetLogicalChildren());
}
[Fact]
public void Child_Control_Should_Appear_In_Panel_Children()
{

Loading…
Cancel
Save