Canvas


CanvasHierarchy: UIElement FrameworkElement Panel

     <Canvas /> 

<Canvas .../> allows content to be positioned according to absolute x- and y-coordinates. Elements are drawn in a unique location unless they occupy the same coordinates, in which case they're drawn in the order in which they appear in markup. The default Height and Width of a Canvas is 0, unless it has a parent that automatically sizes child elements.

Canvas has attached attributes, meaning they are used by child elements and defined as attributes of such. The following is an example of declaring the attached attributes of Canvas within a child element:

     <Canvas>         <TextBox             Canvas.Top="20"             Canvas.Left="20"             Canvas.Right="20"             Canvas.Bottom="20">My text         </TextBox>     </Canvas> 

Attached Attributes


Canvas.Bottom (optional)

A Double value that describes the distance of the element from the bottom of the Canvas


Canvas.Left (optional)

A Double value that describes the distance of the element from the left edge of the Canvas


Canvas.Right (optional)

A Double value that describes the distance of the element from the right edge of the Canvas


Canvas.Top (optional)

A Double value that describes the distance of the element from the top of the Canvas




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