Microsoft Silverlight - SPLessons

Microsoft Silverlight Panel Controls

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

Microsoft Silverlight Panel Controls

Microsoft Silverlight Panel Controls

shape Description

The Panel control,entirety in as a compartment for different controls on the page. It handles the permeability and appearance of the controls that it holds. It likewise permits one for producing controls automatically.The following are the different types of panel controls.

shape Conceptual figure

The following diagram shows you the above panel controls.

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]

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]

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.

ScrollViewer

shape Description

To execute the scrolling in the Silverlight Application, we can utilize the ScrollViewer. [html]<ScrollViewer Height="200" Grid.Column="0"> <StackPanel Orientation="Vertical" Background="SkyBlue" Width="100"> <Rectangle Height="50" Width="100" Fill="Red" /> <Rectangle Height="50" Width="100" Fill="Green" /> <Rectangle Height="50" Width="100" Fill="Blue" /> <Rectangle Height="50" Width="100" Fill="Yellow" /> <Rectangle Height="50" Width="100" Fill="Red" /> <Rectangle Height="50" Width="100" Fill="Green" /> <Rectangle Height="50" Width="100" Fill="Blue" /> <Rectangle Height="50" Width="100" Fill="Yellow" /> <Rectangle Height="50" Width="100" Fill="Red" /> <Rectangle Height="50" Width="100" Fill="Green" /> <Rectangle Height="50" Width="100" Fill="Blue" /> <Rectangle Height="50" Width="100" Fill="Yellow" /> </StackPanel> </ScrollViewer>[/html]

Border

shape Description

Border is additionally one sort of format control which is utilized to give borders to isolate our controls.The accompanying is the sample case about the Border. [html]<Border BorderThickness="6,12,18,10" Padding="4" Background="Pink" CornerRadius="10" BorderBrush="Blue">[/html]

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.
  • Scroll viewer - Execute scrolling in the application.
  • Border - Is an additionally type of control.