July 2017
Beginner
466 pages
9h 37m
English
Canvas is the lightweight panel and can be used to position the children at a specific coordinate position within the view. You can imagine it as a HTML div element and position the elements at (x, y) coordinate. The attached properties Canvas.Left, Canvas.Top can be used to position the elements relative to left and top corners, whereas the Canvas.Right and Canvas.Bottom can be used to position the child elements relative to right and bottom corners:

Here's a simple example that demonstrates the TextBlocks positioned at (75, 30) and (220, 75) respectively:
<Canvas> <TextBlock Text="(75, 30)" Canvas.Left="75" Canvas.Top="30"/> ...
Read now
Unlock full access