Show / Hide Table of Contents

Class Panel

Provides a base class for all Panel elements. Use Panel elements to position and arrange child objects in a UI page.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Panel
Canvas
EdgePanel
DockPanel
Grid
DataGridCellsPresenter
DataGridColumnHeadersPresenter
DataGridDetailsPresenter
DataGridRowsPresenter
TabPanel
UniformGrid
StackPanel
VirtualizingPanel
WrapPanel
Inherited Members
FrameworkElement.MeasureOverride(Size)
FrameworkElement.ArrangeOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.CreateDomElement(Object, Object)
FrameworkElement.OnApplyTemplate()
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.ManageIsEnabled(Boolean)
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.OnGotFocus(RoutedEventArgs)
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.OnLostFocus(RoutedEventArgs)
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public abstract class Panel : FrameworkElement, IFrameworkElement, IUIElement, IDependencyObject

Fields

| Improve this Doc View Source

BackgroundProperty

Identifies the Background dependency property.

Declaration
public static readonly DependencyProperty BackgroundProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

IsItemsHostProperty

Identifies the IsItemsHost dependency property.

Declaration
public static readonly DependencyProperty IsItemsHostProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

Background

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.

| Improve this Doc View Source

Children

Gets the collection of child elements of the panel.

Declaration
public UIElementCollection Children { get; }
Property Value
Type Description
UIElementCollection
| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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
FrameworkElement.LogicalChildren
| Improve this Doc View Source

LogicalOrientation

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

VisualChildrenCount

Gets the number of child UIElement objects in this instance of Panel.

Declaration
protected override int VisualChildrenCount { get; }
Property Value
Type Description
System.Int32

The number of child UIElement objects.

Overrides
FrameworkElement.VisualChildrenCount

Methods

| Improve this Doc View Source

CreateUIElementCollection(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

GetVisualChild(Int32)

Gets a UIElement child of this Panel at the specified index position.

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

A UIElement child of the parent Panel element.

Overrides
FrameworkElement.GetVisualChild(Int32)
| Improve this Doc View Source

INTERNAL_OnAttachedToVisualTree()

Declaration
protected override void INTERNAL_OnAttachedToVisualTree()
Overrides
FrameworkElement.INTERNAL_OnAttachedToVisualTree()

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source