Your Ad Here

Saturday, November 7, 2009

Silver Light

1 What is Silverlight?
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. It is combination of different technolgoies into a single development platform that allows you to select tools and the programming language you want to use. Silverlight integrates seamlessly with your existing Javascript and ASP.NET AJAX code to complement functionality which you have already created. Silverlight aims to compete with Adobe Flash and the presentation components of Ajax. It also competes with Sun Microsystems' JavaFX, which was launched a few days after Silverlight.

2 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)

3 Which platforms and browsers will Silverlight support?
Silverlight will support all major browsers on both Mac OS X and on Windows. Particular care is being taken to account for differences in platform and browser capabilities to ensure a consistent experience including experiences on FireFox, Safari, and Internet Explorer.

4 Will Silverlight support HD quality?
Yes, Silverlight supports 720p, HD quality with considerable performance benefits over other solutions. Performance is dependent upon the central processing unit (CPU) capabilities of your computer and configurations. Generally, in testing, a 3-gigahertz (GHz) CPU and/or dual-core support greatly benefit the HD playback experience.

5 What audio or video formats are supported in Silverlight?
Silverlight supports Windows Media Audio and Video (WMA, WMV7–9) and VC-1, as well as MP3 audio. Additional formats may be available by the final release based on customer feedback.

6 Will Silverlight support all the codecs Windows Media Player supports?
Since Silverlight is a lightweight cross-platform technology, it only carries the most common codecs that are needed for Web playback. However, we are gathering information from customers about the needed codecs and can update Silverlight when necessary.

7.What are the different ways to display text with Silverlight?
Silverlight supports displaying static preformatted text that is comprised out of glyph elements and also dynamic text that uses TextBlock. With glyphs, one needs to position the characters individually while TextBlock supports simple layout.

8.What kinds of fonts are supported with Silverlight?
Beyond standard and western fonts, Silverlight also supports East Asian characters, double-byte characters, and can work with any East Asian font or Middle Eastern font by using the glyphs element and a supporting TrueType font file that supports the requested glyph.

9 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.

10 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.

11 Can you name built-in layout panels you have been using with Silverlight?
You are looking for Canvas, StackPanel and Grid

12 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

13 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

Given XAML below



14 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));

15 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
< name="test" height="20" width="20" left="0" 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.
• For each target value, create a key frame of the appropriate type, set its value and KeyTime, and add it to the animation's KeyFrames collection.
• Associate the animation with a property, as you would with a From/To/By animation
• Set KeySpline property to represent accelerate – slow down behaviour



No comments:

Post a Comment

Your Ad Here
Your Ad Here