Panel


PanelHierarchy: UIElement FrameworkElement

Panel is the base element for all Avalon elements defining layout characteristics. Panel elements are used to position and lay out child elements. Avalon includes a healthy number of predefined elements derived from Panel. The four derived elements useful for UI design are:

  • Canvas

  • Grid

  • DockPanel

  • StackPanel

All elements derived from Panel share a common set of properties, as described in Table 10-1.

Table 10-1. Common properties of elements derived from Panel

Property

Data type

Description

Height

Double

The height of the element.

Width

Double

The width of the element.

IsItemsHost

Boolean

Specifies whether the Panel is a container for elements generated for an ItemHost.


true

If the element is an item host


false

If the element is not an item host

HorizontalAlignment

Enumeration

Specifies how the Panel should align horizontally when placed within a parent Panel or ItemHost.


Left

Align the element on the left of its parent's layout area.


Right

Align the element on the right of its parent's layout area.


Center

Align the element in the center of its parent's layout area.


Stretch

Stretch the element to fill its parent's horizontal layout area.

VerticalAlignment

Enumeration

Specifies how the Panel should align vertically when placed within a parent Panel or ItemHost.


Bottom

Align the element on the bottom of its parent's layout area.


Center

Align the element in the center of its parent's layout area.


Top

Align the element at the top of its parent's layout area.


Stretch

Stretch the element to fill its parent's vertical layout area.

Visibility

Enumeration

Determines the visibility of the element.


Visible

The element is displayed.


Hidden

The element is not displayed but does occupy layout space.


Collapsed

The element is not displayed and does not occupy layout space.

FlowDirection

Enumeration

Describes how text and other child elements flow within a parent. The enumerations are self-explanatory. The default is LeftToRightThenTopToBottom.

  • LeftToRightThenTopToBottom

  • RightToLeftThenTopToBottom

  • TopToBottomThenLeftToRight

  • TopToBottomThenRightToLeft

LayoutTransform

UIElement

The name of the TRansform to be applied during layout of this element.

Margin

Thickness

Represents the margin around the element.

Background

Fill

Describes how to fill the area between the boundaries.

MinWidth

Double

Describes the minimum width of this element.

MinHeight

Double

Describes the minimum height of this element.





XAML in a Nutshell
XAML in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596526733
EAN: 2147483647
Year: 2007
Pages: 217

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net