Class StackPanel
Arranges child elements into a single line that can be oriented horizontally or vertically.
Inherited Members
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 class StackPanel : Panel, IFrameworkElement, IUIElement, IDependencyObject
Examples
You can add a StackPanel with a Horizontal orientation in the XAML as follows:
Or in C#:
StackPanel stackPanel = new StackPanel();
stackPanel.Orientation = Orientation.Horizontal;
Fields
| Improve this Doc View SourceOrientationProperty
Identifies the Orientation dependency property
Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceHasLogicalOrientation
Gets a value that indicates if this StackPanel has vertical or horizontal orientation.
Declaration
protected override bool HasLogicalOrientation { get; }
Property Value
Type | Description |
---|---|
System.Boolean | This property always returns true. |
Overrides
| Improve this Doc View SourceLogicalOrientation
Gets a value that represents the Orientation of the StackPanel.
Declaration
protected override Orientation LogicalOrientation { get; }
Property Value
Type | Description |
---|---|
Orientation | An Orientation value. |
Overrides
| Improve this Doc View SourceOrientation
Gets or sets the dimension by which child elements are stacked.
Declaration
public Orientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
Orientation |
Methods
| Improve this Doc View SourceArrangeOverride(Size)
Declaration
protected override Size ArrangeOverride(Size arrangeSize)
Parameters
Type | Name | Description |
---|---|---|
Size | arrangeSize |
Returns
Type | Description |
---|---|
Size |
Overrides
| Improve this Doc View SourceMeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type | Name | Description |
---|---|---|
Size | constraint |
Returns
Type | Description |
---|---|
Size |