Skip to Main Content
Programming WPF, 2nd Edition
book

Programming WPF, 2nd Edition

by Chris Sells, Ian Griffiths
August 2007
Intermediate to advanced content levelIntermediate to advanced
864 pages
25h 52m
English
O'Reilly Media, Inc.
Content preview from Programming WPF, 2nd Edition

Common Layout Properties

All user interface elements have a standard set of layout properties, mostly inherited from the FrameworkElement base class. These properties are shown in Table 3-2. We saw a few of these in passing in the preceding section, but we will now look at them all in a little more detail.

Table 3-2. Common layout properties

Property

Usage

Width

Specifies a fixed width

Height

Specifies a fixed height

MinWidth

The minimum permissible width

MaxWidth

The maximum permissible width

MinHeight

The minimum permissible height

MaxHeight

The maximum permissible height

HorizontalAlignment

Horizontal position if element is smaller than available space

VerticalAlignment

Vertical position if element is smaller than available space

Margin

Space around outside of element

Padding

Space between element border and content

Visibility

Allows the element to be made invisible to the layout system where necessary

FlowDirection

Text direction

Panel.ZIndex

Controls which elements are on top or underneath

RenderTransform

Applies a transform without modifying the layout

LayoutTransform

Applies a transform that affects layout

A couple of these properties are not from FrameworkElement. Padding is defined in several places: Control, Border, and TextBlock each define this property. It has the same meaning in all cases. It is not quite ubiquitous because padding is meaningful only on elements that have content. Panel.ZIndex may be applied to any element, but it's not strictly inherited from FrameworkElement ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming C#, 4th Edition

Programming C#, 4th Edition

Jesse Liberty
Programming C# 10

Programming C# 10

Ian Griffiths

Publisher Resources

ISBN: 9780596510374Supplemental ContentErrata Page