This article is the third in a series of articles, learning the interface layout in Silverlight 2, adding the grid and panel two layout containers in Silverlight 2, making the interface layout more powerful and flexible.
Canvas panel
Canvas is a basic layout panel in the Silverlight 1.0 era, which uses absolute coordinates. You can position the elements in canvas by using the attached property (attached), and we specify the position of the control relative to the top, bottom, left, and right coordinates of its direct parent container canvas control, with additional properties. The following XAML declares two rectangles, respectively, relative to the left margin of the parent container Canvas 50, and the top margin relative to the parent container canvas is 50 and 150 respectively:
The effect of the post-run interface is as follows: