Microsoft Silverlight - SPLessons

Microsoft Silverlight Layout Controls

Home > Lesson > Chapter 9
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Microsoft Silverlight Layout Controls

Microsoft Silverlight Layout Controls

shape Description

Layout controls are utilized to hold the other child controls in the design. The accompanying are the distinctive sorts of formats in the Silverlight.

shape Conceptual figure

The following diagram shows you the Layout Controls.

StackPanel

shape Description

In StackPanel, we can organize the child components in the Verticle and Horizontal positions. To alter the course of the components, Orientation property is utilized.The accompanying specimen code demonstrates the case about the StackPanel. [html] <StackPanel Orientation="Horizontal"> <Square Height="100" Width="100" Fill="Gray" Opacity="0.2"></Square> <Square Height="100" Width="100" Fill="green" Opacity="0.4"></Square> <Square Height="100" Width="100" Fill="yellow" Opacity="0.6"></Square> </StackPanel> [/html]

Canvas

shape Description

Canvas is utilized to position the child controls in a specific x,y coordinate positions.The accompanying properties are utilized to set the envirnoments. The following sample code shows you the positioning square. [html] <Canvas Width="100" Height="100" Background="yello"> <Square Canvas.Left="50" Canvas.Top="50" Fill="red" Width="100" Height="100"> </Canvas>[/html]

Grid

shape Description

Grid Control is utilized to position the components in the line or section insightful. The accompanying properties are utilized to position components in the network.

Summary

shape Points

  • Microsoft Silverlight Layout Controls - Used to hold the child control layout.
  • Canvas - Is used to position the child control.
  • Stack panel - Positioned in horizontal and vertical environments.
  • Grid - Position the elements in the row or column wise.