Microsoft Silverlight

1,006 views

Published on

Microsoft SIlverlight is a technology to develop Rich Internet Applications.

Published in: Technology
  • Be the first to comment

Microsoft Silverlight

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

×