Class Panel
Provides a base class for all Panel elements. Use Panel elements to position and arrange child objects in a UI page.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public abstract class Panel : FrameworkElement, IFrameworkElement, IUIElement, IDependencyObject
Fields
| Improve this Doc View SourceBackgroundProperty
Identifies the Background dependency property.
Declaration
public static readonly DependencyProperty BackgroundProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsItemsHostProperty
Identifies the IsItemsHost dependency property.
Declaration
public static readonly DependencyProperty IsItemsHostProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceBackground
Gets or sets a Brush that is used to fill the panel.
Declaration
public Brush Background { get; set; }
Property Value
Type | Description |
---|---|
Brush | The brush used to fill the panel. The default is null. |
Children
Gets the collection of child elements of the panel.
Declaration
public UIElementCollection Children { get; }
Property Value
Type | Description |
---|---|
UIElementCollection |
HasLogicalOrientation
Gets a value that indicates whether this Panel arranges its descendants in a single dimension.
Declaration
protected virtual bool HasLogicalOrientation { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the orientation of the Panel is in one dimension; otherwise, false. |
IsItemsHost
Gets a value that indicates whether this Panel is a container for UI items that are generated by an ItemsControl.
Declaration
public bool IsItemsHost { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LogicalChildren
Gets an enumerator that can iterate the logical child elements of this Panel element.
Declaration
protected override IEnumerator LogicalChildren { get; }
Property Value
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator. This property has no default value. |
Overrides
| Improve this Doc View SourceLogicalOrientation
The Orientation of the panel, if the panel supports layout in only a single dimension.
Declaration
protected virtual Orientation LogicalOrientation { get; }
Property Value
Type | Description |
---|---|
Orientation | The Orientation of the panel. This property has no default value. |
ProgressiveRenderingChunkSize
Gets or sets local value of chunk size to render progressively in a batch. Setting this option can improve performance. Value lower than 0 means progressive rendering is disabled. Value of 0 means it uses the size defined at the application level, see ProgressiveRenderingChunkSize. Default value is 0.
Declaration
public int ProgressiveRenderingChunkSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
A value close to 1 can break UI in some cases.
VisualChildrenCount
Declaration
protected override int VisualChildrenCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of child UIElement objects. |
Overrides
Methods
| Improve this Doc View SourceCreateUIElementCollection(FrameworkElement)
Creates a new UIElementCollection.
Declaration
protected virtual UIElementCollection CreateUIElementCollection(FrameworkElement logicalParent)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | logicalParent | The logical parent element of the collection to be created. |
Returns
Type | Description |
---|---|
UIElementCollection | An ordered collection of elements that have the specified logical parent. |
GetTemplateChild(String)
Retrieves the named element in the instantiated ControlTemplate visual tree.
Declaration
protected DependencyObject GetTemplateChild(string childName)
Parameters
Type | Name | Description |
---|---|---|
System.String | childName | The name of the element to find. |
Returns
Type | Description |
---|---|
DependencyObject | The named element from the template, if the element is found. Can return null if no element with name childName was found in the template. |
GetVisualChild(Int32)
Declaration
protected override UIElement GetVisualChild(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index position of the UIElement child. |
Returns
Type | Description |
---|---|
UIElement |
Overrides
| Improve this Doc View SourceINTERNAL_OnAttachedToVisualTree()
Declaration
protected override void INTERNAL_OnAttachedToVisualTree()