Sunday, May 23, 2010

Silverlight 2

->How to set Silverlight contents width as 100%?
Generally you can't set the UserControl width in % like 100% so that the Silverlight contents can spread in the
full screen.To get the 100% width of the screen you can set
width="auto" and height="auto".

->Can you provide a list of Layout Management Panels and when you will use them?
Canvas Panel:-use a canvas for simple layouts and when there is no need to resize panel. Controls can overlapped each other when resizing the panel.
Stack Panel:-use this for grouping controls in a stack (horizontal/vertical). Controls do not overlapped.
Grid Panel:-most flexible, multi row/columns layouts. Similar to a HTML table

->How can style elements be applied? (similar to a CSS file/skins)
Styles elements are supported in the form of application resources. An app.xaml file can be created containing an application resource Xml construct. The target type for each style is set to the control on which the style
needs to be applied.

App.xaml:
Application.Resource>
Style x:Key="MyBorder" TargetType="Border">
setter property="width" value="5">
/style>

Page.xaml:
Border Style="{StaticResource MyBorder}">
...
/Border>

->Can we add normal project reference (normal class library) to the Silverlight project?
No

->Is ADO.NET objects supported in Silverlight Project?
No, Silverlight project doesn't support normal ADO.NET objects like DataTable, DataSet, DataColumn, Database connection providers like SqlConnection, OledbConnection objects.
You can use System.Data namespace but that contains Services related stuffs not ADO.NET stuffs.

No comments:

Post a Comment