<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
|