What is Silverlight
Silverlight is a cross-browser, cross-platform and cross-device browser plug-in that helps companies design, develop and deliver applications and experiences on the Web. A free download that installs in seconds, Silverlight enables a new class of rich, secure and scalable cross-platform experiences.
What is XAML ?
Extensible Application Markup Language (XAML, pronounced zammel) is a declarative XML-based language created by Microsoft which is used to initialize structured values and objects.
What is the difference between WPF and Silverlight?
* Silverlight uses a particular implementation of a XAML parser, with that parser being part of the Silverlight core install. In some cases, the parsing behavior differs from the parsing behavior in Windows Presentation Foundation (WPF), which also has a particular implementation. More information.
* WPF Supports for ADO.Net but coming to the part of Silverlight it doesn't support for ADO.Net but uses a System.Data and a WCF/Web Service to communicate with Data
* WPF is for Windows Development and Silverlight is for Web Development.
Can you name built-in layout panels you have been using with Silverlight?
Canvas, Stack-panel and Grid
What is Storyboard?
Storyboard is a Silverlight class with controls animations with a timeline, and provides object and property targeting information for its child animations
How can you implement following functionality: clicking left mouse on the ellipse should start ellipse movement to the right, ellipse should stop after moving 200px ?
In the answer you are looking for following steps:
1. Ellipse should have on mouse click event handler: either MouseLeftButtonUp or MouseLeftButtonDown, as following MouseLeftButtonUp=”AnimationStart”
2. Canvas should include Storyboard in the resource section :
Canvas.Resources>
…
3. Storyboard should contain double animation object:
4. Storyboard.TargetProperty should be set to (Canvas.Left) and Storyboard.TargetName should be set to name of ellipse object i.e. ellipseTest
How can you set image Source dynamically from C# application to” test.png” file?
Surprisingly it is not as straight forward as it might sound, but anyone who seriously worked with Silverlight should be easily answer it.
One of the ways is: img.Source = new BitmapImage(new Uri("test.png", UriKind.Relative));
How can you implement following functionality: clicking left mouse on the box should start box movement to the right, but instead of having linear speed object should move rapidly when it begins, slows down, and then speeds up again before it ends.
In this question you are looking for Key-frame animations, particulary SplineDoubleKeyFrame and Bezier interpolation.
To animate with a key-frame animation:
• Add Translate Transform Property to Rectangle object
< Rectangle x:Name="test" Height="20" Width="20" Canvas.Left="0" Canvas.Top="10" >
x:Name="saTranslateTransform"
X="0" Y="0" />
• Declare the animation and specify its Duration, as you would for a From/To/By animation.
• Associate the animation with a property, as you would with a From/To/By animation
Silverlight 1.0 uses JavaScript, while Silverlight 2.0 uses C# (managed code) for event handling. We will be describing the event model for Silverlight 2.0.
The Silverlight Event Mode
In Silverlight, there are two event cases:
Input events
Non-input events.
Input Events: The browser that hosts the Silverlight plug-in handles initial input stimulus for the input events. This is because Silverlight works within the plug-in architecture of the hosting browser. From the browser, the event is sent to the Silverlight plug-in. Then, it is raised as an event in the Silverlight Object Model.
Non-input Events: They report a state change to a particular object, for example, the state change events that report asynchronous download state or progress of actions initiated by Web Client. Some non-input events provide lifetime information of objects at a framework level. For example the FrameworkElement.Loaded event
Some events, such as OnError, can only be handled by the Silverlight plug-in instance and exist within the HTML Document Object Model (DOM). These events need to be continually exposed and possibly handled by any script working with the plug-in instance in the DOM. Therefore; these events are not passed to the managed programming model.
What features are available in the Silverlight 1.1 Alpha?
The Silverlight 1.1 Alpha includes all the features available in Silverlight 1.0 Beta plus a number of new features focused primarily on improving the developer productivity and power, including:
* Managed code support
* Support for dynamic languages including managed Microsoft JScript and Python
* Rich UI control model based on WPF
* Improved networking stack with support for REST, RSS, JSON, and POX
* Enhanced, two-way HTML/AJAX bridge
* Comprehensive and consistent base class library
* Support for LINQ (LINQ to Objects, LINQ to XML)
Can we add the reference of a Class library project in Silverlight application project?
No, You can't add the reference of a Class library inside the Silverlight application project. You can only add the reference of another Silverlight application project inside a Silverlight application project. However, you can add the reference of a Web Service or WCF services.
What is Silverlight.js file?
Silverlight.js is a helper file which enables Web sites to create advanced Silverlight installation and instantiation experiences.
For more details visit http://code.msdn.microsoft.com/silverlightjs
What is the .xap file inside ClientBin folder of consuming Silverlight application?
Following is a very good FAQ about the .xap posted on asp.net page.
What does XAP mean?
XAP (pronounced ZAP) is the file extension for a Silverlight-based application package (.xap). This file contains the compressed assemblies and resources of a Silverlight 2 application.
What is a .xap file?
A .xap file is a Silverlight-based application package (.xap) that is generated when the Silverlight project is built.
Why is XAP important?
Tools, such as Visual Studio 2008 with the Microsoft Silverlight Tools Beta 2 for Visual Studio 2008, allow you to create Silverlight applications that are heavily client based using managed code. You can use managed code, such as C# or Visual Basic, and benefit by using the tools that you are used to working with.
How does XAP work?
Once you have created the .xap file (explained below), the Silverlight 2 plug-in downloads the file and runs it in a separate work space.
How do I use a .xap file?
A .xap file is used to contain and transfer the assemblies and resources of a managed code application. This managed code application must be run within the Silverlight 2 browser plug-in.
Visit http://forums.asp.net/t/1277554.aspx for complete details.
What is the use of ClientBin folder?
ClientBin folder is used to place the .xap file of Silverlight application. You can keep this anywhere in your web application but this is the default that is used by the Silverlight.
What is the parent xaml tag of Silverlight page?
UserControl is the parent xaml tag of the Silverlight page. All other tags are placed under UserControl tag.
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
How to change the default page of the Silverlight application?
To change the default page of Silverlight application, you need to set the RootVisual property inside the Application_Startup even of App.xaml file.
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new YourPage();
}
Or if not then you can just specify by right clicking on the page and choose the option as "Set as startup page"
When you create a new project in Silverlight through Visual Studio, how many xaml files are created and what are the uses of those files?
When we create a Silverlight application from Visual Studio, two (2) xaml files are created into the Silverlight project.
They are:
1. App.xaml - App.xaml is a file used to declare shared resources like brushes, various style objects etc. and to handle the global application level event (this is almost similar to global.asax file in asp.net application). By default following events are created in the App.xaml.cs file.
Application_Startup
Application_Exit
Application_UnhandledException
ReportErrorToDOM
2. MainPage.xaml or Page.xaml - This page is the default page of the Silverlight application and when the silverlight application runs this becomes the default page to appear (this page is like the default.aspx page of asp.net application)
Which programming language can be used to write the backend of the Silverlight application?
We can either use Visual C# or Visual Basic to code the backend of the silverlight application. Here backend means the code behind files for the Sivlerlight pages. In fact Ruby,Python can also be used for backend of a silverlight application.
Which language is used to design the layout in Silverlight?
To design the layout of the Silverlight application, XAML language is used. Extensible Application Markup Language (XAML, pronounced zammel [ˈzæmɫ̩]) is a declarative XML-based language created by Microsoft which is used as a user interface markup language to define UI elements, data binding, eventing, and other features.
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:
Page.xaml:
...
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.
What is contained in the AppManifest.xaml file in silverlight?
The AppManifest.xaml file contains the deployment details needed to run the silverlight application.
How does Silverlight 2 differ from Adobe Flash?
You can find difference in depth at : http://silverlight.net/forums/t/3015.aspx

No comments:
Post a Comment