Thickness


ThicknessThickness is a structure and has no class hierarchy.

 <Object AttributeName="Left, Top, Right, Bottom" /> 

<Thickness . . . /> is used to describe the size of the outline of an element. It is also commonly used to describe the size of a Pen used to draw an element, as well as the border of an element such as Rectangle or Ellipse. Furthermore, it describes the Margin and Padding attributes of elements deriving from UIElement (see Chapter 8).

Thickness can be declared either explicitly or through the use of abbreviated markup syntax. Example 7-8 demonstrates the explicit declaration of a Thickness. The Button will have a uniform margin of 10. The same result can be achieved by using the abbreviated markup syntax shown in Example 7-9.

If you are declaring a uniform thickness (meaning all four sides are equal), you can shorten the syntax even further. Example 7-10 shows the declaration of a Thickness with only one value, 10. When declaring a Thickness using a single value, that value is applied to all four attributes (Left, Top, Right, and Bottom). All three examples will produce the same Margin.

Attributes


Left

This Double value describes the thickness of the left side of the element's associated rectangle.


Right

This Double value describes the thickness of the right side of the element's associated rectangle.


Top

This Double value describes the thickness of the top side of the element's associated rectangle.


Bottom

This Double value describes the thickness of the bottom side of the element's associated rectangle.




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

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