diff --git a/Perspex.Controls/Panel.cs b/Perspex.Controls/Panel.cs index e2c11ea408..7496d3fd6f 100644 --- a/Perspex.Controls/Panel.cs +++ b/Perspex.Controls/Panel.cs @@ -15,17 +15,33 @@ namespace Perspex.Controls /// /// Base class for controls that can contain multiple children. /// + /// + /// Controls can be added to a by adding them to its + /// collection. All children are layed out to fill the panel. + /// public class Panel : Control, ILogical, IItemsPanel { private Controls children; private ILogical childLogicalParent; + /// + /// Initializes a new instance of the class. + /// public Panel() { this.childLogicalParent = this; } + /// + /// Gets or sets the children of the . + /// + /// + /// Even though this property can be set, the setter is only intended for use in object + /// initializers. Assigning to this property does not change the underlying collection, + /// it simply clears the existing collection and addds the contents of the assigned + /// collection. + /// public Controls Children { get @@ -65,11 +81,15 @@ namespace Perspex.Controls } } + /// + /// Gets the logical children of the control. + /// IPerspexReadOnlyList ILogical.LogicalChildren { get { return this.children; } } + /// ILogical IItemsPanel.ChildLogicalParent { get @@ -84,14 +104,20 @@ namespace Perspex.Controls } } + /// protected virtual void OnChildrenAdded(IEnumerable child) { } + /// protected virtual void OnChildrenRemoved(IEnumerable child) { } + /// + /// Clears for the specified controls. + /// + /// The controls. private void ClearLogicalParent(IEnumerable controls) { foreach (var control in controls) @@ -100,6 +126,10 @@ namespace Perspex.Controls } } + /// + /// Sets for the specified controls. + /// + /// The controls. private void SetLogicalParent(IEnumerable controls) { foreach (var control in controls) @@ -108,6 +138,11 @@ namespace Perspex.Controls } } + /// + /// Called when the collection changes. + /// + /// The event sender. + /// The event args. private void ChildrenChanged(object sender, NotifyCollectionChangedEventArgs e) { List controls;