Sei sulla pagina 1di 28

R4R provide basic Silverlight Tutorials concept with Silverlight Examples .

Through R4R you can develop Silverlight programming concept. R4R provide Silverlight Interview Questions with answers.R4R provide Silverlight Languages study materials in easy way.

Silverlight Tutorials
1.1 Silverlight Services basic tutorials

Silverlight Interview Questions with Answers


2.1 2.2 2.3 2.4 Silverlight Subjective Questions with Answers Silverlight Interview Questions with Answers Silverlight Objective Questions And Answers FAQ

Introduction Of SilverLight:
Silverlight is a powerful cross-browser & cross-platform technology for building the next generation web experience & rich internet applications for the web. Silverlight applications are delivered to a browser in a text-based markup language called XAML. XAML is a declarative markup language that you can use to define the UI elements for your Silverlight-based application. Silverlight is considered as a competitor to Adobe's flash technology. One of the design goals of the Silverlight technology is to fill the gap between windows application and web application in terms of creating Graphical User Interface (GUI). So far web developers were not able to make client happy in terms of UI, but now web developer will be able to full fill this with the help of Silverlight technology. You can run Silverlight in most of all the popular browsers like Internet Explorer, Firefox, Chrome, Safari etc. Silverlight can run in various devices and operating systems like Windows, Apple Mac OS-X and Windows Phone 7. Using Silverlight you can create rich, visually stunning web applications like flash. Also you can create smooth animations using Storyboards; you can stream media over the net etc. Silverlight web browser plug-in comes as free to install (approximately 4-5 MB in size). You can download the required plug-in from Microsoft Silverlight Site.

Architecture Of Silverlight:

Silver light architecture as a combination of four important blocks: Some .NET framework components: - Silver light uses some components from .NET framework. One of the main components is WPF. Many of the UI components ( check box , buttons , text boxes etc) , XAML parsing etc are taken from the core WPF system. It also has taken components like WCF to simplify data access. It also have CLR for memory management, safety checking and garbage collection. The base class libraries of Net are used for string manipulations, algorithms, expressions, collections and globalization. Presentation core: - The core presentation framework has functionalities to display vector 2d animations, images, media, DRM and handle inputs like mouse and keyboard. Other technologies: - Silver light interacts with other technologies like Ajax and javascript. So it also borrows some functionalities from there technologies. Hosting: - Silver light animations finally run under the browser environment. So it has a the hosting functionality which helps to host the application the browser , expose a DOM by which JavaScript can manipulate the silver light components and it also has a installer functionality which helps to install silver light application and plug-in in the browser environment. One of the things which you can notice from the architecture diagram is that the presentation core reads from the XAML file for rendering. The XAML is a component which is a part of the .NET framework and the rendering part is done by the presentation core. Why Silverlight: 1. Support of .NET framework - if you are already .NET developer it is easy to start programming on Silverlight. 2. Support of Managed code - you can write programming in your favorite language which .NET CLR supports like C#,VB.NET, Dynamic languages(IronPython, IronRuby). 3. Better development tools -Visual Studio 2010, Expression Blend. 4. Large community- available lot of learning resource as compare to Flash technology. 5. Integration with Enterprise based technologies like WPF, LINQ etc...

MINIMUM SYSTEM REQUIREMENTS FOR INSTALLING SILVERLIGHT SDK FOR DEVELOPMENT IS AS FOLLOWS: If you are a developer and want to start working on it, you must need the following environment to install the Silverlight tools.

Operating System Developer Tools

Microsoft Windows XP Service Pack 2 or higher Visual Studio 2008 SP1 (for Silverlight 3) Visual Studio 2010 (for Silverlight 3 & Silverlight 4) Microsoft Expression Blend 3 (for Silverlight 3) Microsoft Expression Blend 4 (for Silverlight 3 & Silverlight 4) Silverlight 3 Tools for Visual Studio 2008 SP1 Silverlight 4 Tools for Visual Studio 2010

Designers Tools

Silverlight SDK

How Silverlight would change the Web:

1. Highest Quality Video Experience : prepare to see some of the best quality
videos you have seen in your life, all embedded in highly graphical websites. The same research and technology that was used for VC-1, the codec that powers BluRay and HD DVD, is used by Microsoft today with its streaming media technologies. Cross-Platform, Cross-Browser : Finally build web applications that work on any browser, and on any operating system. At release, Silverlight will work with Mac as well as Windows! The Mono project has also already promised support for Linux!. Developers and Graphic Designers can play together! : Developers familiar with Visual Studio, Microsoft.net will be able to develop amazing Silverlight applications very quickly, and they will work on Mac's and Windows. Developers will finally be able to strictly focus on the back end of the application core, while leaving the visuals to the Graphic Design team using the power of XAML. Cheaper : Silverlight is now the most inexpensive way to stream video files over the internet at the best quality possible. Licensing is dead simple, all you need is IIS in Windows Server, and youre done. Support for 3rd Party Languages : Using the power of the new Dynamic Language Runtime, developers will now be able to use Ruby, Python, and

2. 3.

4. 5.

6.

7. 8.

9.

EcmaScript! This means a Ruby developer can develop Silverlight applications, and leverage the .net Framework! Cross-Platform, Cross-Browser Remote Debugging : If you are in the need to debug an application running on a Mac, no problem! You can now set breakpoints, step into/over code, have immediate windows, and all that other good stuff that Visual Studio provides. The best development environment on the planet : Visual Studio is an award winning development platform! As it continues to constantly evolve, so will Silverlight! Silverlight offers copy protection : Have you noticed how easy it is to download YouTube videos to your computer, and save them for later viewing ? Silverlight will finally have the features enabling content providers complete control over their rich media content! Streaming television, new indie broadcast stations, all will now be possible! Extreme Speed :There is a dramatic improvement in speed for AJAX-enabled websites that begin to use Silverlight, leveraging the Microsoft .net framework

Difference Between Silverlight and ASP.NET AJAX.. The Rich Internet Application (RIA) analysis shows a strong preference for AJAX at 58%.AJAX frameworks have for a long time been strong in the open source community. However, the analysis segmented the MicroSoft Windows-only users and found 92% do not use or intend to use Silverlight, 52% want AJAX and 24% Flex.

Benefits of Silverlight Silverlight offers cross-domain support for applications Silverlight plugin is just a 1MB download and is supported in windows XP and above. Silverlight also has a browser plugin but still needs to reach at pace with flash. supports asynchronous calls

Benefits of Ajax:

Ajax is absed on open standards so widely accepted and supported. Bandwidth usage of web is less as specfic demands are accomplished. Works with Flash and Flex Key component of Web2.0 apps Benefits of regular web apps like low cost etc. Supports asynchronous calls

Disadvantages of Ajax: Ajax also uses javascript,CSS and XHTML but there is an issue of cross browser compatibility that is what might work on one browser might not work on another browser which makes the debugging difficult. Benefits of Flash / Flex: Flash actually has the power of animation The flash player used to run the Falsh/ Flex apps are installed in about a billion computers. Flash is a multi-platform application that will appear the same on all browsers and platforms as long as its plug-in has be downloaded. Flash should be used when the primary goal is visual effects to the users but if looking forward to earn potential customers then it should be limited. Silverlight Tutorials Introduction of silverlight Why Silverlight? Silverlight 1.0 Silverlight 2.0 First Application of Silverlight Rotate Image in 3D direction using Silverlight 3 Pixel Shader Effects in Silverlight How to Add XML File in Your Silverlight Project Silverlight Feature comparison with Flash Features Limitations of Silverlight and flash

Introduction of SilverLight
What is Silverlight? Silverlight is the new Microsoft technology on web platform for Rich Internet Applications (RIA) launched by Microsoft in 2007 Silverlight supports multiple Operating Systems called cross-platform technology, which includes Windows family of OS, Mac, and Linux with moonlight technology (Moonlight is an open source implementation of Silverlight, primarily for Linux and other Unix/X11 based operating systems) Silverlight is also supports multiple devices called cross-device technology, which include mobile devices to desktop browsers to 720p HDTV video modes etc Silverlight is a browser plug-in approximately 4MB in size, it is client side free software for easy and fast less than 10 sec one time installation available for any client side browsers

Silverlight supports the display of high-definition video files, and sending them over the Net Silverlight applications are delivered to a browser in a text-based markup language called XAML. XAML is a declarative markup language that you can use to define the UI elements for your Silverlight-based application Silverlight is considered as a competitor to Adobe's flash technology of the design goals of the Silverlight technology is to fill the gap between windows application and web application in terms of creating Graphical User Interface (GUI). So far web developers were not able to make client happy in terms of UI, but now web developer will be able to full fill this with the help of Silverlight technology

Platforms Silverlight supports? Mac OS Windows Vista Windows XP SP2 Windows 2000 Windows Server 2003 Linux (Moonlight)

System requirements for Silverlight The system requirements for Microsoft Silverlight and associated technologies are listed below. Windows Operating System: Windows 7,Windows Vista; Windows XP Service Pack 2 Intel Pentium III 450MHz or faster processor (or equivalent) 128MB of RAM Mac OS Operating System: Apple Mac OS X 10.4.8 or above Intel Core Duo 1.83GHz or faster processor 128MB of RAM Linux Moonlight

Why Silverlight?
Here is the list of advantage why we should go with Silverlight over the Flash and other technologies already available: 1. Support of .NET framework - if you are already .NET developer it is easy to start programming on Silverlight. 2. Support of Managed code - you can write programming in your favorite language which .NET CLR supports like C#,VB.NET, Dynamic languages (IronPython, IronRuby). 3. Better development tools -Visual Studio 2010, Expression Blend. 4. Large community- available lot of learning resource as compare to Flash technology. 5. Integration with Enterprise based technologies like WPF, LINQ etc.

How Silverlight would change the Web


Highest Quality Video Experience : prepare to see some of the best quality videos you have seen in your life, all embedded in highly graphical websites. The same research and technology that was used for VC-1, the codec that powers BluRay and HD DVD, is used by Microsoft today with its streaming media technologies. Cross-Platform, Cross-Browser : Finally build web applications that work on any browser, and on any operating system. At release, Silverlight will work with Mac as well as Windows! The Mono project has also already promised support for Linux!. Developers and Graphic Designers can play together : Developers familiar with Visual Studio, Microsoft.net will be able to develop amazing Silverlight applications very quickly, and they will work on Mac's and Windows. Developers will finally be able to strictly focus on the back end of the application core, while leaving the visuals to the Graphic Design team using the power of XAML. Cheaper : Silverlight is now the most inexpensive way to stream video files over the internet at the best quality possible. Licensing is dead simple, all you need is IIS in Windows Server, and youre done. Support for 3rd Party Languages : Using the power of the new Dynamic Language Runtime, developers will now be able to use Ruby, Python, and EcmaScript! This means a Ruby developer can develop Silverlight applications, and leverage the .net Framework Cross-Platform, Cross-Browser Remote Debugging : If you are in the need to debug an application running on a Mac, no problem! You can now set breakpoints, step into/over code, have immediate windows, and all that other good stuff that Visual Studio provides. The best development environment on the planet : Visual Studio is an award winning development platform! As it continues to constantly evolve, so will Silverlight! Silverlight offers copy protection : Have you noticed how easy it is to download YouTube videos to your computer, and save them for later viewing ? Silverlight will finally have the features enabling content providers complete control over their rich media content! Streaming television, new indie broadcast stations, all will now be possible! Extreme Speed :There is a dramatic improvement in speed for AJAX-enabled websites that begin to use Silverlight, leveraging the Microsoft .net framework

Silverlight 1.0
Silverlight 1.0 consists of the core presentation framework, which is responsible for UI, interactivity and user input, basic UI controls, graphics and animation, media playback, DRM support, and DOM integration. Main features of Silverlight 1.0 Built-in codec support for playing VC-1 and WMV video, and MP3 and WMA audio within a browser.

Silverlight supports the ability to progressively download and play media content from any web-server. Silverlight also optionally supports built-in media streaming. Silverlight enables you to create rich UI and animations, and blend vector graphics with HTML to create compelling content experiences. Silverlight makes it easy to build rich video player interactive experiences.

Silverlight 2.0
Silverlight 2.0 includes a version of the .NET Framework, with the full Common Language Runtime as .NET Framework 3.0; so it can execute any .NET language including VB.NET and C# code. Unlike the CLR included with .NET Framework, multiple instances of the CoreCLR included in Silverlight can be hosted in one process. With this, the XAML layout markup file (.xaml file) can be augmented by code-behind code, written in any .NET language, which contains the programming logic. This version ships with more than 30 UI controls(including TextBox, CheckBox, Slider, ScrollViewer, and Calendar controls), for two-way databinding support, automated layout management (by means of StackPanel, Grid etc) as well as data-manipulation controls, such as DataGrid and ListBox. UI controls are skinnable using a template-based approach. Main features of Silverlight 2.0 A built-in CLR engine that delivers a super high performance execution environment for the browser. Silverlight uses the same core CLR engine that we ship with the full .NET Framework. Silverlight includes a rich framework library of built-in classes that you can use to develop browser-based applications. Silverlight includes support for a WPF UI programming model. The Silverlight 1.1 Alpha enables you to program your UI with managed code/event handlers, and supports the ability to define and use encapsulated UI controls. Silverlight provides a managed HTML DOM API that enables you to program the HTML of a browser using any .NET language. Silverlight doesn't require ASP.NET to be used on the backend web-server (meaning you could use Silverlight with with PHP on Linux if you wanted to). Silverlight 2 includes Deep Zoom, a technology derived from Microsoft Live Labs Seadragon. It allows users to zoom into, or out of, an image (or a collage of images), with smooth transitions, using the mouse wheel. The images can scale from 2 or 3 megapixels in resolution into the gigapixel range, but the user need not wait for it to be downloaded entirely; rather, Silverlight downloads only the parts in view, optimized for the zoom level being viewed. Silverlight 2 also allows limited filesystem access to Silverlight applications. It can use the operating system's native file dialog box to browse to any file (to which the user has access).

First Application of Silverlight


Step 1: Open a New Project.

Step 2: Select a Silverlight Application and press OK

Step 3: At beginning we take a example of Canvas Control. Drag a canvas control and TextBlock control from ToolBox. you can move these as your choice.

Design Code: <UserControl x:Class="SilverlightApplication8.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Canvas x:Name="canvas1"> <TextBlock Canvas.Left="10" Canvas.Top="10" Height="23" Name="textBlock1" Text="Microsoft" /> <TextBlock Canvas.Left="37" Canvas.Top="39" Height="23" Name="textBlock2" Text="Silverlight" /> </Canvas> </UserControl> Step 4: Run the application

Rotate Image in 3D direction using Silverlight


Add Three ToggelButton and an image in your Project

Write below code in your MainPage.xaml. <UserControl x:Class="SilverlightApplication14.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources><Storyboard x:Name="RotateZStoryBoard"> <DoubleAnimation Storyboard.TargetName="rotation" Storyboard.TargetProperty="RotationZ" From="0.0" To="360.0" Duration="0:0:10" RepeatBehavior="Forever" /> </Storyboard><Storyboard x:Name="RotateYStoryBoard"> <DoubleAnimation Storyboard.TargetName="rotation" Storyboard.TargetProperty="RotationY" From="0.0" To="360.0" Duration="0:0:10" RepeatBehavior="Forever" /> </Storyboard> <Storyboard x:Name="RotateXStoryBoard"> <DoubleAnimation Storyboard.TargetName="rotation" Storyboard.TargetProperty="RotationX" From="0.0" To="360.0" Duration="0:0:10"

RepeatBehavior="Forever" /> </Storyboard> </Grid.Resources><Grid.RowDefinitions> <RowDefinition Height="30" /><RowDefinition /> </Grid.RowDefinitions> <StackPanel Grid.Row="0" Orientation="Horizontal"> <ToggleButton x:Name="rotateX" Width="90" Content="Rotate X-Axis" Click="rotateX_Click" /> <ToggleButton x:Name="rotateY" Width="90" Content="Rotate Y-Axis" Click="rotateY_Click" /> <ToggleButton x:Name="rotateZ" Width="90" Content="Rotate Z-Axis" Click="rotateZ_Click" /> </StackPanel><Image Grid.Row="1" Margin="0 50 0 0" Stretch="None" Source="/SilverlightApplication14;component/Indian%20Flag %203.jpg"> <Image.Projection> <PlaneProjection x:Name="rotation" /></Image.Projection></Image></Grid></UserControl> The Design shown like:

MainPge.xaml.cs Code:

using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Xml; namespace SilverlightApplication14 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void rotateX_Click(object sender, RoutedEventArgs e) { if (rotateX.IsChecked.Value) { RotateXStoryBoard.Begin(); } else { RotateXStoryBoard.Stop(); } } private void rotateY_Click(object sender, RoutedEventArgs e) { if (rotateY.IsChecked.Value) { RotateYStoryBoard.Begin(); } else { RotateYStoryBoard.Stop(); } } private void rotateZ_Click(object sender, RoutedEventArgs e) { if (rotateZ.IsChecked.Value) { RotateZStoryBoard.Begin(); } else {

Run Your Silverlight Aplication (Click on Rotate Z-Axis)

3 Pixel Shader Effects in Silverlight


Write below code in your MainPage.xaml <UserControl x:Class="SilverlightApplication14.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions>

<StackPanel Margin="8" Grid.Column="0"> <TextBlock Text="(Hi, Dear) A Drop Shadow!" FontSize="20"> <TextBlock.Effect> <DropShadowEffect /> </TextBlock.Effect></TextBlock> <TextBlock Text="(Helloooo) A Slight Drop Shadow!" FontSize="20"> <TextBlock.Effect> <DropShadowEffect ShadowDepth="2" /> </TextBlock.Effect></TextBlock> <TextBlock Text="(Good Bye) Blur Effect!" FontSize="20"> <TextBlock.Effect><BlurEffect /> </TextBlock.Effect></TextBlock> </StackPanel></Grid></UserControl>

The Design page shown like

Run the Silverlight Application

How to Add XML File in Your Silverlight Project


Add Xml File named as Employee.xml and write the code given below

<?xml version="1.0" encoding="utf-8" ?> <Employee> <customer id="10001" first="Aditya" last="Tiwari" company="R4R">aditya@r4r.com</customer> <customer id="10002" first="Harsh" last="Singh" company="R4R Techsoft">harsh@r4r.com</customer> <customer id="10003" first="Anil" last="Yadav" company="Onlineexam">anil@r4r.com</customer> <customer id="10004" first="Manoj" last="Kumar" company="R4R">manoj@r4r.com</customer> <customer id="10005" first="Rajesh" last="Kumar" company="R4R Consultants">rajesh@r4r.com</customer> </Employee> .XAML Code: Write this code in MainPage.xaml <UserControl x:Class="SilverlightApplication14.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White">

<ListBox x:Name="EmployeeList" Width="400" Height="200" SelectionChanged="EmployeeList_SelectionChanged" /> </Grid> </UserControl>

.CS Code: Write this code in MainPage.xaml.cs page using using using using using using using using using using using using System; System.Collections.Generic; System.Linq; System.Net; System.Windows; System.Windows.Controls; System.Windows.Documents; System.Windows.Input; System.Windows.Media; System.Windows.Media.Animation; System.Windows.Shapes; System.Xml;

namespace SilverlightApplication14 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); PopulateEmployeeList(); } private void PopulateEmployeeList() { XmlReader reader = XmlReader.Create("Employee.xml"); reader.MoveToContent(); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == "customer") { EmployeeList.Items.Add(new ListBoxItem() { Content = reader.GetAttribute("last") + ", " + reader.GetAttribute("first") + " (" + reader.ReadInnerXml() + ")" }); } if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "Employee") { break; } } reader.Close(); }

Run the Silverlight Application

Silverlight Feature comparison with Flash Features

Silverllight Flash Animation - Silverlight supports the WPF animation model, which is not only time based instead of frame based, but lets you define the start and end conditions and it will figure The animation model is frame based. out how to get there for you. No need to deal with matrixes like in flash. Also no need to calculate positions on various frames. It just works. Flash stores its shapes using binary shape records. In Silverlight uses XAML. XAML is text order to write shape definitions, you will need to either based and can be output using a license a 3rd party Flash file format SDK, or build your simple XML object. own. It isnt too difficult, but it does require a bit of a learning curve. The debugging with Silverlight is The debugging with flash is harder than Silverlight. simpler than with flash. Silverlight lets you embed true type font information directly into your projects, and download that Dealing with fonts is fairly complex with flash. information with the web client object. Downloader is no longer available but we have web client. XAML is declarative while ActionScript ActionScript is an imperative language, which brings is imperative. Using imperative itself the pitfalls of imperative languages when languages to build UIs goes back to compared with declarative languages.

the early days of DOS and Windows, when developers had to manage all of the API nuances when interacting with graphical panes. Additional Support for mobile devices with desktop and desktop browsers:Silverlight is supported by Windows mobile device as part of a new service that the NBL have built. Flash is not spread as across the vast majority of both Silverlight applications and media desktops and mobiles platforms, as compared to streaming can be run on a mobile Silverlight. Flash requires Flash Lite preinstalled on phone - so Silverlight even at this mobile devices. stage is about more than just the desktop browser and desktop market. Silverlight may be seen soon on the Symbian OS too. Silverlight does not require video codec to run industry standard videos Flash requires video codec to run .WMV videos. like .WMV Silverlight supports scalable video Flash does not support scalable video formats from HD formats from HD to mobile. to mobile Silverlight supports HardwareFlash does not support Hardware-assisted editing and assisted editing and encoding encoding solutions. solutions. Silverlight provides End-to-end server Flash does not provide End-to-end server and and application platform. application platform. Media server licensing is cheaper Media server licensing is costier than Silverlight. than flash. Silverlight supports Scalable full Flash does not support Scalable full screen video. screen video.

Limitations of Silverlight and flash

Silverlight Flash Now, we got moonlight for Linux user This limitation doesnt exist with Flash. Silverlight will (naturally) be using the WMV Flash Video turned Flash into a mechanism for and Silverlight will add to the use of the WMV delivering media with far more potential than file format. any other solution that is .flv. Now, we are able to read the data from web Even flash is also lacking this area. Flash can services (including RESTful service), XML fromread data source in terms of XML or text from URL. Silverlight 2 supports Socket some URL and can use it. Same thing communication too. silverlight also can read. The standard controls are included in Flash has rich set of control library. Silverlight 2 beta1. Once the accessibility features are provided Flash test tools are already in place. with Silverlight versions, any existing test tools that support driving UI through

Accessibility will be fully enabled to automate Silverlight applications Silverlight 1.0 does not support GIF-file Support all image formats. format. Webcam and Microphone support it not there. Flash supports it. Built in file upload/download support is not Inbuilt Upload/download support is there. available. The performance of Silverlight and Flash will be nearly the same. While Silverlight is using XAML as description language in a noncompressed format size of Silverlight component is large.In practical Size of flash component is smaller. implementation of similar component in Flash and Silverlight it has found that size of Silverlight component is approximately 10-20 times larger than Flash component. We got .xap now. but there are a number of Flash ships in single component that is .swf. people who like to get XAML with managed Images/video/sounds also incorporated in code. (SL 1.1 Alpha style) single .swf package. Silverlight 2 supports Socket communication Flash allows creating XML Socket object. too. It has found in practical implementation of To avoid this type of flickering in flash, refresh image animation, at some extent flickering layout or cache bitmap functionalities are occurs on image. available. It has found in practical implementation of video play, audio may start playing before showing movie on screen. It has also found Flash doesnt face these types of issues. video can still continue to play after redirecting to other page. It may be it is bug of current beta release. Flash can be played as Windows application also by downloading player for it. Flash can be XPF or XBAP is already there for that. also packaged as .exe which can be deploying standalone. Silverlight is new in market and required time Flash is exist from many years and have to get acceptance in market. strong acceptance in market. With some media file sound processing can Cant do sound processing. possible.

Silverlight Interview Questions And Answers

Page 1
Ques: 1 What is Microsoft Silverlight? Ans: Silverlight is a cross-browser, cross-platform plug-in for delivering the

next generation of Microsoft .NET-based media experiences and rich interactive applications for the Web. Silverlight applications are run as client-side applications without the need to refresh the browser to update the UI. However, because of the built-in .NET framework, Silverlight applications can easily integrate with serverside controls and services. Using Silverlight's implementation of the .NET framework, developers can easily integrate existing libraries and code into Silverlight applications. One of the design goals of the Silverlight technology is to fill the gap between windows application and web application in terms of creating Graphical User Interface (GUI). Ques: 2 Why Use Silverlight? Ans: Support of Managed code - you can write programming in your favorite language which .NET CLR supports like C#,VB.NET, Dynamic languages(IronPython, IronRuby) # Better development tools -Visual Studio 2010, Expression Blend. Built-in codec support for playing VC-1 and WMV video, and MP3 and WMA audio within a browser. Silverlight supports the ability to progressively download and play media content from any web-server. Silverlight also optionally supports built-in media streaming. Silverlight enables you to create rich UI and animations, and blend vector graphics with HTML to create compelling content experiences. Silverlight makes it easy to build rich video player interactive experiences. # Large community- available lot of learning resource as compare to Flash technology # Integration with Enterprise based technologies like WPF, LINQ etc... # Silverlight integrates the XAML declarative language with the .NET framework. It delivers rich video, audio, and graphics. Ques: 3 Which platforms Silverlight supports? Ans: * Mac OS * Windows Vista * Windows XP SP2 * Windows 2000 * Windows Server 2003 * Linux (Moonlight) Ques: 4 Which browsers Silverlight supports? Ans: Supported browsers: Microsoft Internet Explorer 6, Windows Internet Explorer 7, Mozilla Firefox 1.5.0.8, and Firefox 2.0.x. Ques: 5 What are the system requirements for Silverlight? Ans: Operating System: Windows Vista; Windows XP Service Pack 2 o Intel Pentium III 450MHz or faster processor (or equivalent) o 128MB of RAM * Mac OS o Operating System: Apple Mac OS X 10.4.8 or above o Intel Core Duo 1.83GHz or faster processor

o 128MB of RAM Ques: 6 What is Moonlight? Ans: Moonlight was built by Novell in collaboration with Microsoft which provided Novell with test suites, specifications, open source code and Media Codecs to create an entirely open sourced Silverlight-compatible implementation for Unix systems. Access to licensed Media Codecs (MP3, WMV, VC-1) is provided by Microsoft to Moonlight 1.0 and 2.0 users. The first time that you access a web site that requires these codecs, Moonlight will prompt you to download the codecs from Microsoft and install those on your system. * To run Silverlight applications on Linux. * To provide a Linux SDK to build Silverlight applications. * To reuse the Silverlight engine we have built for desktop applications. Ques: 7 What is the difference between Silverlight 1.0 and 2? Ans: Silverlight 1 is pure AJAX and Javascript based. All the code has to be written in Javascript and XAML. Silverlight 2 supports managed code. When Silverlight 2 runtime is installed, it installs a limited version of .NET runtime on the client machine. This allows .NET programmers to write managed code to be executed on the client PC and provide a better user experience to the users. Of course, there is security and restrictions built in to it so that the code has limited access to the client computer. In Silverlight 1.0, the XAML code was referenced directly by the Silverlight object embedded in the browser. In Silverlight 2, however, the embedded object references an XAP package that contains the XAP file, assemblies, and resources necessary to run the Silverlight application. Ques: 8 What is Silverlight Plug-In? Ans: * The Silverlight plug-in is a very lightweight component that is necessary for users to access Silverlight applications. The plug-in download and install take only a few moments and do not take up much hard drive space. * The Silverlight plug-in is responsible for accessing the Silverlight object in the Web page, downloading and accessing the XAP package, setting up the program environment, and beginning execution of the application. * When a Web page containing a Silverlight application is displayed, the user should be given a link to download the plug-in from Microsoft if the plug-in is not already installed Ques: 9 What is Silverlight Runtime? Ans: Silverlight CLR is a subset of the .NET Framework that contains components and libraries, including data integration, extensible Windows controls, networking, base class libraries, garbage collection, and the common language runtime (CLR).

Silverlight Runtime is a browser plug-in to support Silverlight enabled applications. If Silverlight runtime is not installed, browsers will not be able to run Silverlight elements in the browser. You can set up your Silverlight tags such a way that your browser will automatically prompt the user to download and install the Silverlight plug in when your application is launched in the browser. Installing the run time is a onetime operation on the client. Once installed, it will be automatically launched when any Silverlight application is loaded in the browser. Ques: 10 What is Silverlight SDK? Ques: 11 What is Silverlight SDK? Ans: Silverlight SDK is a set of tools, documentation, samples and templates for the web developers to help them easily develop Silverlight enabled applications. The SDK is not really mandatory to develop Silverlight applications; however, SDK will make development much easier. This SDK provides a working sample control for Silverlight 4 that implements all the features of two additional assemblies, which together provide a rich set of user experience for consumption of Microsoft Bing search results. The first component is a reusable framework extension to the Microsoft Silverlight Toolkit. This framework is designed to provide: * Support controls for the sample Bing component * A reusable view control toolkit for implementing and using some of the advanced data metaphors shown in the Bing search component. * Components such as CloudView, TileView, BandCloudView and StackView can be used in any Silverlight application. All the controls in this assembly support theming and accessibility. All these controls are built on the same infrastructure as the Silverlight Toolkit Controls. Ques: 12 What is .xap file? Ans: A .xap file is an application package (.xap) that is generated when the Silverlight project is built. A .xap file has an application manifest file (AppManifest.xaml) and the necessary DLLs needed by the application. it 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. Ques: 13 What is Silverlight.js file? Ans: Silverlight.js file is a Java Script helper file. Silverlight.js is a helper file which enables Web sites to create advanced Silverlight installation and instantiation experiences. You can call the createObject and createObjectEx functions defined in this file to embed the Silverlight plug-in in a Web page. It supports for adding a Silverlight application to a web page through Java Script.

Ques: 14 What is the use of ClientBin folder? Ans: The ClientBin folder is used for placing .xap file of a Silverlight application. This folder can be kept anywhere in the web application. but this is the default that is used by the Silverlight. So if you have silverlight applications associated to your web project their .xap files should go there. Ques: 15 Explain how can Silverlight use ASX files. Ans: An ASX file is an XML file in which media files are specified in the playlist. Using ASX files in silver is pretty simple. Assign the source property of a MediaElement object to the ASX file name. Ques: 16 Explain Silverlight application life-cycle Ans: Silverlight is running on the client, not on the server as normal ASP.NET pages... there is no such as Page Life Cycle in Silverlight. But there are some events that will be executed on the client side in a specific order. 1. First the App constructor in the App.xaml file. 2. The App's Applicaiton_Startup event which will be executed every time you open your Silverlight app. 3. The Main page's Constructor.. It will be the constructor of the page assigned to the RootVisual properly within the App's Application_Startup event. 4. InitializeCompnent, only to make sure the components are singed to variables so you can use them. I hope this one will be removed in the future and be handled elsewhere. 5. If you have hooked up to the Loaded event within the Main Page Constructor, that event will then be executed, same with the rest event listen in the order they will be executed if you have hooked up to them. 6. Then the SizeChanged event. 7. Then the LayoutUpdated event. 8. Then GotFocus if you mark the Silverlight app. 9. If you navigate from your Silverlight app or close the Browser the App's Application_Exit event will be executed. Ques: 17 What are the main features and benefits of Silverlight? Ans: The following are the features of SilverLight: 1. Built in CLR engine are available for deliverd a super high performance execution environment for the browser. 2. Includes rich power framework of built-in class library for using with browser-based applications. 3. Supports WPF Userinterface interface programming model. 4. Provides a managed HTML DOM API which is used for HTML enabled programs of a browser using .NET technology. 5. Silverlight supports PHP or Linux environment. Hence does not require ASP.NET. 6. Permits limited access to file system for applications. An OS native file dialog box can be used for using any file. The following are the benefits of Silverlight:

1. Supports high quality videos 2. Supports cross-platform and cross-browser applications 3. Features are available for developers with Visual Studio for developing applications very quickly. 4. Most inexpensive way for video streaming over internet at the best possible quality. 5. Supports third party languages such as Ruby, Python, EcmaScript! 6. Supports remote debugging. 7. Provides copy protection. 8. Flexible Programming Model with Collaboration Tools. 9. High-quality media, low-cost delivery. Ques: 18 Which language is Silverlight developed in? Ans: C# and C++. Ques: 19 What are the other RIA technologies besides Silverlight? Ans: Adobe Flex, Java FX, Adobe Flash are some of the other RIA technologies besides Silverlight. Ques: 20 What is meant by RIA? Ans: RIA is an acronym for Rich Internet Application. A Rich Internet Application provides a great experience for its users. It should be easy to use, engaging, and targeted to perform its task very well. To many this means a desktop-application-like-experience delivered through the web. This may include common features such as drag-and-drop data manipulation and imaging/drawing/charting capabilities, but it is not a requirement to include any of these. Microsoft .NET RIA Services helps to simplify the n-tier application pattern by combining the ASP.NET and Silverlight platforms. RIA Services provides a pattern using which you can write application logic that can run on the midtier and controls access to data for queries, changes, and custom operations. It also provides support for data validation, authentication, and roles by integrating with Silverlight components on the client and ASP.NET on the middle tier. Ans: RIA is an acronym for Rich Internet Application. A Rich Internet Application provides a great experience for its users. It should be easy to use, engaging, and targeted to perform its task very well. To many this means a desktop-application-like-experience delivered through the web. This may include common features such as drag-and-drop data manipulation and imaging/drawing/charting capabilities, but it is not a requirement to include any of these. Microsoft .NET RIA Services helps to simplify the n-tier application pattern by combining the ASP.NET and Silverlight platforms. RIA Services provides a pattern using which you can write application logic that can run on the midtier and controls access to data for queries, changes, and custom operations. It also provides support for data validation, authentication, and roles by

integrating with Silverlight components on the client and ASP.NET on the middle tier. Ans: RIA is an acronym for Rich Internet Application. A Rich Internet Application provides a great experience for its users. It should be easy to use, engaging, and targeted to perform its task very well. To many this means a desktop-application-like-experience delivered through the web. This may include common features such as drag-and-drop data manipulation and imaging/drawing/charting capabilities, but it is not a requirement to include any of these. Microsoft .NET RIA Services helps to simplify the n-tier application pattern by combining the ASP.NET and Silverlight platforms. RIA Services provides a pattern using which you can write application logic that can run on the midtier and controls access to data for queries, changes, and custom operations. It also provides support for data validation, authentication, and roles by integrating with Silverlight components on the client and ASP.NET on the middle tier.

Silverlight Interview Questions And Answers

Page 1
Tot Show al Post Your Answers Pos Answers ts

Questions

Last Post

Which programming language can be used to write the backend of the Silverlight application? 1.Visual basic 2.C# 3.Both 4.None What is name of Linux version of silverlight ? What is name of Linux version of silverlight ?

Show Answers

Post Your Answers

29.12.10 Ashish Gupta

Show Answers

Post Your Answers

Rahul R Chavhan

Show

1. LinLight Answers 2. MoonLight 3. MoonLit 4.Silverlight Can we add the reference of a Class Show library project in Silverlight Answers application project? 1.No 2.Yes

Post Your Answers

29.12.10 Ashish Gupta

Post Your Answers

29.12.10 Ashish Gupta

3.Both (1) and (2) 4.none Which language is used to design the layout in Silverlight? Show 1.HTML Answers 2.XAML 3.C# 4.NONE Can we add normal project reference (normal class library) to the Silverlight project? 1. Yes Answers 2. No 3. Yes, we can but that project should not have used ADO.NET objects 4.None Is ADO.NET objects supported in Silverlight Project? 1. Yes 2. No 3.None Is Silverlight free? 1. Yes 2. No 3.None Which language is Silverlight developed in?

Post Your Answers

29.12.10 Ashish Gupta

Show

Post Your Answers

Rahul R. Chavhan

Show Answers

Post Your Answers

29.12.10 Ashish Gupta

Show Answers

Post Your Answers

29.12.10 Ashish Gupta

Show

1.C Answers 2.C# 3.Both (1) and (2) 4.Visual Basic Do I need to have the .NET Framework installed in order to use ? 1. Yes 2. No 3.None Will Silverlight work with my current Windows Media?

Post Your Answers

29.12.10 Ashish Gupta

Show Answers

Post Your Answers

29.12.10 Ashish Gupta

Show Answers Answers

1 1

Post Your Answers Post Your Answers

29.12.10 Ashish Gupta 29.12.10 Ashish Gupta

Can additional formats be added for Show playback? 1. Yes

2. No 3.None

Potrebbero piacerti anche