Microsoft (Silverlight)
-
Upload
vinayak-hegde -
Category
Education
-
view
1.322 -
download
0
Transcript of Microsoft (Silverlight)
![Page 1: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/1.jpg)
Microsoft
Silverlight
![Page 2: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/2.jpg)
Agenda• What is Silverlight ?• Features• What’s new in C# 3.0• Controls and Containers• Third Party Tools• Hello World
![Page 3: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/3.jpg)
What is Silverlight?• Browser Plugin
• Earlier known as WPF/E (Windows Presentation Foundation / Everywhere)
• Cross-browser, cross-platform, cross-device implementation of the .NET Framework.
• < 10 sec download
• Provides animations, vector graphics, audio-video playback
![Page 4: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/4.jpg)
Cross Browser• Works on all major browsers
![Page 5: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/5.jpg)
Cross Platform• Works on Windows, Linux and Mac OS X
![Page 6: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/6.jpg)
Cross Device• Coming to Nokia and Windows Mobile phones
![Page 7: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/7.jpg)
How to Install ?
1. Install Visual Studio 2008.2. Install Visual Studio Service Pack 1.3. Install Silverlight Tools for Visual Studio.
(Optional) Install Expression Blend for designing XAML.
![Page 8: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/8.jpg)
Supported Languages• Silverlight 1.0– Javascript
• Silverlight 2.0–C#–VB.NET–Dynamic Lanaguages Supported• Microsoft JScript• IronPython• IronRuby
![Page 9: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/9.jpg)
Advantages• Single, consistent runtime for browser-based applications.
• Performance is promising. (Prime Number Calculator)
• There is an official open source implementation of Silverlight (Moonlight)
• Search engines can potentially index text within a Silverlight application, just as they can with Flash.
• Silverlight interprets XAML directly (Flex doesn’t)
![Page 10: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/10.jpg)
Disadvantages• The design tools (Expression Blend and Expression Design) are
comparatively new.
• Silverlight supports SOAP web services, or REST but doesn’t have an optimized binary protocol like Adobe’s ActionScript Message Format (AMF), which likely means slower performance in some scenarios.
• Silverlight is a browser-only solution (Adobe has AIR).
• Development on Windows platform only.
• Yet to penetrate market.
![Page 11: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/11.jpg)
Architecture
![Page 12: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/12.jpg)
New Features in C# 3.0
![Page 13: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/13.jpg)
New Features in C# 3.0• Implicit Type Variables
var i = 1;
When the compiler sees this in the code, it tries to figure out the type of the variable based on the value you assigned it.
• Object Initializer
Human h = new Human {Name = “Fahim”, Age = 23};
![Page 14: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/14.jpg)
Lambda Expressions
• A lambda expression is an anonymous function that can contain expressions and statements.
• Example x => x > 3
An Anonymous function that takes x (int) as an input and returns whether x is greater than 3 or not ( true or false).
![Page 15: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/15.jpg)
Lambda Expression (Cont)
• Func<int,bool> myFunction = x => x > 3;Console.WriteLine (myFunction ( 4 ) );True
• Func<int,int,bool> myFunction = ( x ,y ) => x < y; Console.WriteLine( myFunction ( 4 , 3 ) );False
![Page 16: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/16.jpg)
Attached Property
• An attached property is intended to be used as a type of global property that is settable on any object.
• Example<DockPanel>
<CheckBox DockPanel.Dock="Top">Hello</CheckBox></DockPanel>
![Page 17: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/17.jpg)
Extension Methods
• Special Kind of Static Methods
• Enable you to add methods to instances of existing types without creating a new derived type, recompiling, or modifying the original type.
![Page 18: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/18.jpg)
Extension Methodsclass Program{ static void Main(string[] args) { string name = "folio3"; Console.WriteLine(name.Decorate()); } }
public static class StringExtension { public static string Decorate(this string str) { return "**** " + str + " ****"; } }
![Page 19: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/19.jpg)
LINQ
LINQ is a series of language extensions that supports data querying in a type-safe way
![Page 20: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/20.jpg)
LINQ Language INtegrated Query
• The most common extension methods are the LINQ standard query operators.
![Page 21: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/21.jpg)
• Results from a LINQ query are as IEnumerable<T> • Evaluation does not occur until you iterate the
results.• Some extension methods (e.g Count) iterate the
results.• Delayed evaluation means latest is always evaluated.
Re-evaluated if iterated again.• Use ToArray or ToList to get a “snapshot”
Delayed Evaluation
![Page 22: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/22.jpg)
XAML
• XAML or eXtensible Application Markup Language is a general purpose declarative language to create the tree of .net objects.
• Like XHTML and MXML.
![Page 23: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/23.jpg)
XAML Example<Grid> <Button x:Name="buttonClick" Click="buttonClick_Click" Content="Click Here"
Width="100" Height="100" /> <Label Content="Click the button" /></Grid>
![Page 24: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/24.jpg)
Layout Manager Controls• Canvas • StackPanel• Grid• Border
![Page 25: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/25.jpg)
Richer User Interfaces
• Calendar• TextBox (w/
Watermark)• Sliders• Buttons• Lists• Lots more!
![Page 26: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/26.jpg)
XAP File• Really a zip file in disguise
• Contains any content marked to be included in download and built in assemblies.
• .XAP file is what is downloaded to client machine
![Page 27: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/27.jpg)
App.Xaml• Contains Application Resources• Entry point for the application• This where you set your start page for the
application• Handles following events–Application Startup–Application Exit–Application Unhandled Exception
![Page 28: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/28.jpg)
Job Trends
![Page 29: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/29.jpg)
Third Party Tools
![Page 30: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/30.jpg)
Visifirehttp://www.visifire.com/
![Page 31: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/31.jpg)
Component Onehttp://www.componentone.com/
![Page 32: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/32.jpg)
Useful Links
• Official Website http://www.silverlight.net
• Useful Article• http://fahimilyas.blogspot.com/2008/05/road
-to-silverlight-part-1.html
• Silverlight Articles http://www.silverlightarticles.com
![Page 33: Microsoft (Silverlight)](https://reader035.fdocuments.us/reader035/viewer/2022062905/5549f14db4c90518488b5422/html5/thumbnails/33.jpg)
Demo Collected ByVinayak Nandikal