Duration: 19 minutes
Summary: In this video, we continue the Silverlight 5 discussion of container controls. Today, we will tak about the DockPanel and Canvas. When it comes to the Canvas, we can specify the Left and Top values of the control to know where to place it in the Canvas. We can also specify the ZIndex if two controls overlap to know which one is placed in the top.
In the case of the DockPanel, we get more flexibility. In this case, we can dock controls to the left, top, bottom, and right of the panel. When we do not specify the dock value, the control takes the rest of the space (in our case it was the center). But there is also a property of the panel called LastChildFill. This is a boolean property. As the name implies, if we set this property to false, the control will not fill the rest of the space. The DockPanel is very useful as a parent container control. For example we can create a DockPanel to start with. Then dock a StackPanel to the left that contains the links the user can click…
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: Silverlight 5 and Visual Studio 2010
Keyword: Silverlight 5, Visual Studio 2010, XAML, Button, Content, Margin, DockPanel, Canvas, Rectangle, TextBox, Dock, LastChildFill, Width, Height, Left, Top, ZIndex, Fill, StrokeThickness.