Monday, August 11, 2014

Canvas control

The most basic layout panel in WPF. All contained controls are positioned on the basis of four
attached properties: Canvas.Top, Canvas.Bottom, Canvas.Right, and Canvas.Left. The coordinates can be specified relative to any side of the panel.

The panel is typically used to group 2D graphic elements together and not to layout user interface elements.

By default, controls declared later in the XAML are shown on top of controls declared earlier in the XAML. However, you can set the Z-order (that is, which control appears on top) manually by setting the Canvas.ZIndex attached property. Canvas.ZIndex takes an arbitrary integer value. Controls with a higher Canvas.ZIndex value always appear on top of controls with a lower Canvas.ZIndex value. An example is shown here:

<Button Canvas.ZIndex="12">This one is on top</Button>
<Button Canvas.ZIndex="5">This one is on the bottom</Button>






No comments:

Post a Comment