SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
Fun with Silverlight 4




                                Rajesh Lal




     Illustrated Guide to Creating Rich Internet Applications

(with examples in C#, ASP.NET, XAML, Media, Webcam, AJAX, REST and Web Services)
Fun with silverlight4 Table of Content @iRajLal
Contents at a Glance

              Introduction ................................................................................................................ 1


    Part I    Developing Silverlight Applications
         1    Design a Rich Internet Application ..........................................................................11
         2    Extend Control Framework ......................................................................................69
         3    Create Compelling Graphics ................................................................................ 119
         4    Work with Animation ............................................................................................. 193


   Part II    Interact with the Web
         5    Extend Browser Programming Model ................................................................... 231
         6    Brind Data Visualization to the Web ..................................................................... 295
         7    Develop with ASP.NET and AJAX........................................................................ 379
         8    Work with Web Services....................................................................................... 413


   Part III   Advance with Media
         9    Play with Media .................................................................................................... 451
       10     Fun with Advanced Media .................................................................................... 505


  Part IV     Appendix
       11     Silverlight: A Beginner’s Guide ............................................................................. 559
Table of Contents
Contents
Introduction
       What’s in the Book                                              1
               Section 1: Develop Silverlight Applications   2
               Section 2: Interact with Web    2
               Section 3: Advance with Media 3

Part I: Developing Silverlight Applications

1. Design a Rich Internet Application
       Use Common Controls                                            11
              Use a Grid      11
              Use Grid Splitter Control   15
              Create Popup Control 18
              Work with Stack Panel 20
              Use Repeat Button       22
              Use ToolTip     25
              Create Canvas and Shapes    29
       Handle Input and Events                                        32
              Capture Mouse Input 32
              Capture Mouse 37
              Capture Keyboard Input      42
              Use Ink 47
       Use Dynamic Resources                                          52
              Load XAML Resource dynamically           52
              Load XAML Files dynamically 55
              Load XAML Code          56
	      	      Load	Image	file		       58
              Load Media File 60
              Load Audio File 62
              Use Fonts       63

2. Extend Control Framework
       Customize Common Controls                                      69
              Create a Reusable Control       69
              Apply Style to the Login Control       71
              Use Template with controls      75
              Create Rich experience with Visual State Manager   78
       Reusable Control                                               82
              Create a Thumbnail User Control        82
              Create a Slideshow Custom Control      90
       DeepZoom                                                       100
              Create Single Image Zoom Application 100
              Create Multiple Image Zoom with Information 108
Table of Contents



3. Create Compelling Graphics
      Understand Layout                                           119
             Work with Border        119
             Understand Padding      125
      Work with Advanced Shapes                                   127
             Work with Lines128
             Draw Curves     131
             Create Geometry         132
             Draw Arcs       135
             Create Yin Yan 137
      Work with Paintbrushes                                      139
             Create Solid Color Brush        140
             Create a Web Safe Palette       143
	     	      Use	Predefined	Colors	 145
             Work with Linear Gradient Brush         145
             Create a Sun Glow effect        148
             Work with Linear Gradient Brush         150
             Create Gradient for Prism       151
             Work with Radial Gradient Brush         153
             Work with Radial Gradient       155
             Create Sun glow using Radial Gradient 157
             Create a Sunrise picture using Radial Gradient 159
             Create a Glass Orb      160
             Use Media Brush         162
             Use Image and Video in a Brush          164
             Apply ImageBrush and VideoBrush in a shape 165
             Image and Video Bursh on a Control      166
      Work with Transformations                                   168
             Use Rotate Transformation       168
             Use Scale Transformation        171
             Use Skew Transformation         173
             Use Translate Transformation 176
      Manipulate Image                                            178
             Stretch Image 179
             Clip Image      182
             Apply Opacity to an Image       184
             Shadow Image 186
             Glow Image      187
	     	      Add	Reflection	to	an	Image	     189

4. Work with Animation
      Understanding Animation                                     193
             Use Double Animation 196
             Customize the speed of the animation 199
             Rotate an Element      201
             Create Multiple Animations    202
             Create Point Animation 203
Create a Solar Eclipse animation        205
              Use Point Animation with Gradient       207
              Create Color Animation 209
              Create a Rainbow with Fade In effect.   214
       Understand Keyframe Animation                                217
              Create Discrete KeyFrame Animation      220
              Create Splined KeyFrame Animation                     222

Part II: Interacting with the Web

5. Extend Browser Programming Model
       Get Browser Information         232
              Read Query Strings       234
              Implement History Navigation 238
              Work with Cookies        241
       Understand SilverlightHost                                   244
              Access Silverlight Plug-in Values     245
              Create Transparent Background 247
              Work with Custom Parameters 249
              Slideshow Widget with Custom Parameters        251
              Create Silverlight Dynamically 254
       Use Local Storage                                            257
              Open File Dialog         257
              Work with Isolated Store         261
	      	      Add	Local	files	to	Isolated	Store	    266
	      	      Add	embedded	files	to	Isolated	Store	 271
              Work with Isolated Settings      275
       Work through HTML Bridge                                     279
              Access Elements in the HTML Page      279
              Access Document Object Model (DOM) 283
              Access Script on the Page        286
              Access Silverlight from the Page      289

6. Bring Data Visualization to Web
       Know Data                                                    295
              Know Array data structures      296
              Bind Data with One-Way and Two-Way      Binding 311
              Work with Data Template         318
              Use Data Validation and Conversion      322
       Work with XML Data                                           330
              Use XML Reader           331
              Create XML using XML Writer 342
              Work with XLinq          346
              Serialize, De-Serialize XML data        357
       Understand JSON Data                                         360
              Consume JSON Data        360
              Use JSON Data Contract Serializer       366
Table of Contents



      Work with RSS and Atom feeds                                      369
             Read RSS 2.0 and Atom 1.0 feed      370
             Format XML as RSS and Atom 1.0 Feed 373

7. Develop with ASP.NET and AJAX
      Use Silverlight in ASP.NET                                        379
              Create Silverlight using Server code   380
              Work with ASP.NET Silverlight Server Control 381
              Work with ASP.NET Media Control        383
              Encapsulate Silverlight in ASP.NET User Control           386
      Work with ASP.NET AJAX Extension                                  390
              Use ADO.NET Data Services                                 394
              Use ADO.NET Data Services for CREATE Operation      399
              Use ADO.NET Data Services for READ Operation        404
              Use ADO.NET Data Services for UPDATE Operation      408
              Use ADO.NET Data Services for DELETE Operation      410

8. Work with Web Services
      Interact with REST Web Service                                    413
              Use Silverlight to GET from Flickr REST API   414
              Use Silverlight to POST to Twitter REST API   421
      Work with ASP.NET Web service (ASMX)                              426
      Use Silverlight enabled WCF service                               433
      Develop with .NET/WCF RIA Service                                 439

Part III: Advance with Media

9. Play with Media
      Work with Rich Media                                              451
             Create a Rich Video Experience         452
             Work with Media State and Full Screen Mode  457
             Use Video Brush        463
             Learn SetSource and MediaStream        470
      Encode and Deliver Media                                          472
             Progressive Download Media             473
             Know Media Streaming 475
             Smooth Streaming       479
      Create Media Markers                                              483
             Add Keywords and Thumbnails Media Markers 483
             Add Closed Captioning to a Media       487
             Add Chapters List and Subtitles        490
      Edit Media                                                        494
             Insert Image Before/After Media        494
             Embed Image into Media          497
             Embed Video into Media (Picture in Picture) 500
             Embed XAML into Media           501
10. Fun with Advanced Media
       Create an Advanced Media Player                                505
               Custom Media Player with Timeline     506
               Use Media Player Object with Media Skins        510
               Customize Encoder Media Player        512
       Working with Playlists                                         520
               Create Client Side Playlists    520
               Work with Web Playlists 524
               Create Server-Side Playlists    527
       Use Webcam                                                     529
               Use Audio Capture to Record Audio     530
               Use Webcam to Record Video 535
               Take a Screenshot from Silverlight    542
       Use Silverlight Media Frameworks (SMF)                         545
               SMF Simple Media Player         546
               SMF Progressive Download Player       549
               SMF Smooth Streaming Player 551

Part IV: Appendix

11. Silverlight:A Beginner’s Guide
       Silverlight Basics                                             560
       Silverlight Plug-in                                            561
                Steps for rendering Silverlight on a web page 562
       Silverlight Host                                               563
       Silverlight Application File (.XAP)                            564
       Silverlight XAML                                               568
	      	        Extensible	Markup	Language	files	(Visual	Part)		568
                XAML .NET Files (Application Part)      572
       Silverlight and .NET Framework                                 574
                Understand the Embedded CLR 575
                NET Framework Libraries for Silverlight 575
       Create Silverlight Application                                 578
                Creating the Hello World Application    578
                Create an Event Driven Application      582
Fun with silverlight4 Table of Content @iRajLal
About the Author

                   Rajesh Lal is passionate about Silverlight and Web
                   technologies. He likes to take a pragmatic approach to
                   solving problems and make extra effort to simplify
                   complex topics. Rajesh has worked on software design
                   and development for more than ten years and had
                   authored multiple books on Windows Gadgets, Web
                   Widgets and Smartphone Web development. He has a
                   Master’s degree in Computer Science from Texas and
                   currently lives in Mountain View, California.

                   Book resources       : http://silverlightfun.com
                   Twitter              : @rajeshlalnokia
                   Personal website     : http://irajesh.com
                   Email                : connectrajesh@hotmail.com
Fun with silverlight4 Table of Content @iRajLal
Technical Reviewers
                  Rick Kingslan is a Senior Technical Writer for the Micro-
                  soft Office division, working on the Lync Server product
                  line developing planning and deployment documenta-
                  tion for customers. Rick worked on the Lync Server 2010
                  resource kit, as well as the Office Communications Server
                  2007 R2 and 2007 resource kit books. Prior to taking on
                  the role of a technical writer, he worked as a Consultant,
                  Microsoft Consulting Services (MCS) delivering solutions
                  to enterprise customers. During his tenure with MCS, Rick
                  travelled internationally to 12 countries on four continents,
                  delivering Application Compatibility and Remediation
                  seminars. The training was sponsored by the Windows
                  division in an effort to expedite the transition of customers
                  moving from Windows XP and Server 2003.

                  Rick lives and works in Omaha, Ne (yes, Nebraska IS that
                  large, flat place right between Chicago and Denver…OK,
                  Iowa is there, too.) He is married to Sue. Rick’s blog is
                  “Musings of a Constant Geek” at
                  http://rkingsla.wordpress.com/




                  Kunal Chowdhury is a Microsoft MVP (Silverlight), a
                  Telerik MVP, a Codeproject MVP & Mentor, Speaker in
                  various Microsoft events, Author, passionate Blogger and
                  a Software Engineer by profession. He has a very good
                  skill over Silverlight, LightSwitch, Windows Phone 7, C#,
                  XAML & Blend. He shares his technical findings, tutorials
                  in his technical blog. Follow his Blog and Facebook page to
                  be updated on latest articles.

                      Technical Blog     http://www.kunal-chowdhury.com
                      Silverlight-Zone   http://www.silverlight-zone.com
                      Twitter            http://twitter.com/kunal2383
                      Facebook Page      https://www.facebook.com/blog.kunal2383
Fun with silverlight4 Table of Content @iRajLal
Dedication
To my wife Lakshmi. Kaise Mujhe Tum Mil Gayee (How did I find you!)




Acknowledgement
Writing is a fascinating journey, but it is also long and tiring. I would like to extend my special
thanks to all my friends and family who supported me during this journey. Specially my mom and
dad and my brothers Rakesh and Rajeev, for all the wonderful things I have learned from them, and
Simple, and Shilpi for just, being so wonderful, and to my inspiration and my wife Neelu the most
beautiful thing happned to me in the last ten years.

Mais conteúdo relacionado

Semelhante a Fun with silverlight4 Table of Content @iRajLal

Synapse india reviews on i phone and android os
Synapse india reviews on i phone and android osSynapse india reviews on i phone and android os
Synapse india reviews on i phone and android ossaritasingh19866
 
Compressor 2 User Manual
Compressor 2 User ManualCompressor 2 User Manual
Compressor 2 User ManualVideoguy
 
Arduino Cookbook.pdf
Arduino Cookbook.pdfArduino Cookbook.pdf
Arduino Cookbook.pdfTracy Hill
 
Xcode4 userguide Apple
Xcode4 userguide AppleXcode4 userguide Apple
Xcode4 userguide ApplePragati Singh
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGLGary Yeh
 
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
Mike Taulty MIX10 Silverlight 4 Accelerated FundamentalsMike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentalsukdpe
 
Scaling Eclipse on HiDPI Monitors - Niraj Modi
Scaling Eclipse on HiDPI Monitors - Niraj ModiScaling Eclipse on HiDPI Monitors - Niraj Modi
Scaling Eclipse on HiDPI Monitors - Niraj ModiEclipse Day India
 
How to make your Eclipse application HiDPI ready!
How to make your Eclipse application HiDPI ready!How to make your Eclipse application HiDPI ready!
How to make your Eclipse application HiDPI ready!Lakshmi Priya
 
Final Cut Express 4 User Manual
Final Cut Express 4 User ManualFinal Cut Express 4 User Manual
Final Cut Express 4 User Manualguest866798
 
Manning.silverlight.4.in.action.sep.2010
Manning.silverlight.4.in.action.sep.2010Manning.silverlight.4.in.action.sep.2010
Manning.silverlight.4.in.action.sep.2010Longhui Li
 
Coding GRIN GLOBAL Wizards
Coding GRIN GLOBAL WizardsCoding GRIN GLOBAL Wizards
Coding GRIN GLOBAL WizardsEdwin Rojas
 
6351420 autocad-gstarted(2)
6351420 autocad-gstarted(2)6351420 autocad-gstarted(2)
6351420 autocad-gstarted(2)Yasir Qazalbash
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkitPaul Jensen
 
The Ring programming language version 1.8 book - Part 199 of 202
The Ring programming language version 1.8 book - Part 199 of 202The Ring programming language version 1.8 book - Part 199 of 202
The Ring programming language version 1.8 book - Part 199 of 202Mahmoud Samir Fayed
 

Semelhante a Fun with silverlight4 Table of Content @iRajLal (20)

Synapse india mobile apps update
Synapse india mobile apps updateSynapse india mobile apps update
Synapse india mobile apps update
 
Synapse india reviews on i phone and android os
Synapse india reviews on i phone and android osSynapse india reviews on i phone and android os
Synapse india reviews on i phone and android os
 
J2 ee
J2 eeJ2 ee
J2 ee
 
Compressor 2 User Manual
Compressor 2 User ManualCompressor 2 User Manual
Compressor 2 User Manual
 
SVG 101
SVG 101SVG 101
SVG 101
 
Extjs Cookbook
Extjs CookbookExtjs Cookbook
Extjs Cookbook
 
Arduino Cookbook.pdf
Arduino Cookbook.pdfArduino Cookbook.pdf
Arduino Cookbook.pdf
 
Xcode4 userguide Apple
Xcode4 userguide AppleXcode4 userguide Apple
Xcode4 userguide Apple
 
Big Insights v4.1
Big Insights v4.1Big Insights v4.1
Big Insights v4.1
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
Mike Taulty MIX10 Silverlight 4 Accelerated FundamentalsMike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
 
Scaling Eclipse on HiDPI Monitors - Niraj Modi
Scaling Eclipse on HiDPI Monitors - Niraj ModiScaling Eclipse on HiDPI Monitors - Niraj Modi
Scaling Eclipse on HiDPI Monitors - Niraj Modi
 
Finalcute e01
Finalcute e01Finalcute e01
Finalcute e01
 
How to make your Eclipse application HiDPI ready!
How to make your Eclipse application HiDPI ready!How to make your Eclipse application HiDPI ready!
How to make your Eclipse application HiDPI ready!
 
Final Cut Express 4 User Manual
Final Cut Express 4 User ManualFinal Cut Express 4 User Manual
Final Cut Express 4 User Manual
 
Manning.silverlight.4.in.action.sep.2010
Manning.silverlight.4.in.action.sep.2010Manning.silverlight.4.in.action.sep.2010
Manning.silverlight.4.in.action.sep.2010
 
Coding GRIN GLOBAL Wizards
Coding GRIN GLOBAL WizardsCoding GRIN GLOBAL Wizards
Coding GRIN GLOBAL Wizards
 
6351420 autocad-gstarted(2)
6351420 autocad-gstarted(2)6351420 autocad-gstarted(2)
6351420 autocad-gstarted(2)
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
The Ring programming language version 1.8 book - Part 199 of 202
The Ring programming language version 1.8 book - Part 199 of 202The Ring programming language version 1.8 book - Part 199 of 202
The Ring programming language version 1.8 book - Part 199 of 202
 

Mais de Raj Lal

Teamcalendar.AI presskit 1.0
Teamcalendar.AI presskit 1.0Teamcalendar.AI presskit 1.0
Teamcalendar.AI presskit 1.0Raj Lal
 
UX Workshop: How to design a product with great user experience
UX Workshop: How to design a product with great user experienceUX Workshop: How to design a product with great user experience
UX Workshop: How to design a product with great user experienceRaj Lal
 
Workshop Stanford University - 28th July 2018 on Website Optimization
Workshop Stanford University - 28th July 2018 on Website Optimization  Workshop Stanford University - 28th July 2018 on Website Optimization
Workshop Stanford University - 28th July 2018 on Website Optimization Raj Lal
 
The art and science of website optimization
The art and science of website optimizationThe art and science of website optimization
The art and science of website optimizationRaj Lal
 
UX Workshop - Talent 2 Talent Conference, Ryerson University, Toronto Canada,...
UX Workshop - Talent 2 Talent Conference, Ryerson University, Toronto Canada,...UX Workshop - Talent 2 Talent Conference, Ryerson University, Toronto Canada,...
UX Workshop - Talent 2 Talent Conference, Ryerson University, Toronto Canada,...Raj Lal
 
Why Toastmasters - The story of a fisherman
Why Toastmasters - The story of a fishermanWhy Toastmasters - The story of a fisherman
Why Toastmasters - The story of a fishermanRaj Lal
 
Build Amazing Camera Apps for Superphones - Silicon Valley Code Camp, 6 Oct, ...
Build Amazing Camera Apps for Superphones - Silicon Valley Code Camp, 6 Oct, ...Build Amazing Camera Apps for Superphones - Silicon Valley Code Camp, 6 Oct, ...
Build Amazing Camera Apps for Superphones - Silicon Valley Code Camp, 6 Oct, ...Raj Lal
 
Evolution of User Interface - Digital Web & Design Innovation Summit SFO 20 S...
Evolution of User Interface - Digital Web & Design Innovation Summit SFO 20 S...Evolution of User Interface - Digital Web & Design Innovation Summit SFO 20 S...
Evolution of User Interface - Digital Web & Design Innovation Summit SFO 20 S...Raj Lal
 
Designing Killer Apps for Mobile Devices ModevUX May 9 2013 mclean VA - @iRajLal
Designing Killer Apps for Mobile Devices ModevUX May 9 2013 mclean VA - @iRajLalDesigning Killer Apps for Mobile Devices ModevUX May 9 2013 mclean VA - @iRajLal
Designing Killer Apps for Mobile Devices ModevUX May 9 2013 mclean VA - @iRajLalRaj Lal
 
Html5 Whats around the bend
Html5 Whats around the bendHtml5 Whats around the bend
Html5 Whats around the bendRaj Lal
 
Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...
Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...
Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...Raj Lal
 
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...Raj Lal
 
Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...
Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...
Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...Raj Lal
 
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...Raj Lal
 
Developing Apps for Nokia Windows Phone VSLiv Conference May 15, 2012 @iRajLal
Developing Apps for Nokia Windows Phone  VSLiv Conference May 15, 2012 @iRajLalDeveloping Apps for Nokia Windows Phone  VSLiv Conference May 15, 2012 @iRajLal
Developing Apps for Nokia Windows Phone VSLiv Conference May 15, 2012 @iRajLalRaj Lal
 
Upgrade Your Website to HTML5 - VSLive Conference New York @iRajLal
Upgrade Your Website to HTML5 - VSLive Conference New York  @iRajLalUpgrade Your Website to HTML5 - VSLive Conference New York  @iRajLal
Upgrade Your Website to HTML5 - VSLive Conference New York @iRajLalRaj Lal
 
Honeycomb User Interface Design @iRajLal
Honeycomb User Interface Design @iRajLalHoneycomb User Interface Design @iRajLal
Honeycomb User Interface Design @iRajLalRaj Lal
 
Two thumbs User Interface @iRajLal
Two thumbs User Interface @iRajLalTwo thumbs User Interface @iRajLal
Two thumbs User Interface @iRajLalRaj Lal
 
Angry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLal
Angry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLalAngry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLal
Angry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLalRaj Lal
 
Fun with QML and JavaScript: Embedded Linux Conference 11th April 2011, Hotel...
Fun with QML and JavaScript: Embedded Linux Conference 11th April 2011, Hotel...Fun with QML and JavaScript: Embedded Linux Conference 11th April 2011, Hotel...
Fun with QML and JavaScript: Embedded Linux Conference 11th April 2011, Hotel...Raj Lal
 

Mais de Raj Lal (20)

Teamcalendar.AI presskit 1.0
Teamcalendar.AI presskit 1.0Teamcalendar.AI presskit 1.0
Teamcalendar.AI presskit 1.0
 
UX Workshop: How to design a product with great user experience
UX Workshop: How to design a product with great user experienceUX Workshop: How to design a product with great user experience
UX Workshop: How to design a product with great user experience
 
Workshop Stanford University - 28th July 2018 on Website Optimization
Workshop Stanford University - 28th July 2018 on Website Optimization  Workshop Stanford University - 28th July 2018 on Website Optimization
Workshop Stanford University - 28th July 2018 on Website Optimization
 
The art and science of website optimization
The art and science of website optimizationThe art and science of website optimization
The art and science of website optimization
 
UX Workshop - Talent 2 Talent Conference, Ryerson University, Toronto Canada,...
UX Workshop - Talent 2 Talent Conference, Ryerson University, Toronto Canada,...UX Workshop - Talent 2 Talent Conference, Ryerson University, Toronto Canada,...
UX Workshop - Talent 2 Talent Conference, Ryerson University, Toronto Canada,...
 
Why Toastmasters - The story of a fisherman
Why Toastmasters - The story of a fishermanWhy Toastmasters - The story of a fisherman
Why Toastmasters - The story of a fisherman
 
Build Amazing Camera Apps for Superphones - Silicon Valley Code Camp, 6 Oct, ...
Build Amazing Camera Apps for Superphones - Silicon Valley Code Camp, 6 Oct, ...Build Amazing Camera Apps for Superphones - Silicon Valley Code Camp, 6 Oct, ...
Build Amazing Camera Apps for Superphones - Silicon Valley Code Camp, 6 Oct, ...
 
Evolution of User Interface - Digital Web & Design Innovation Summit SFO 20 S...
Evolution of User Interface - Digital Web & Design Innovation Summit SFO 20 S...Evolution of User Interface - Digital Web & Design Innovation Summit SFO 20 S...
Evolution of User Interface - Digital Web & Design Innovation Summit SFO 20 S...
 
Designing Killer Apps for Mobile Devices ModevUX May 9 2013 mclean VA - @iRajLal
Designing Killer Apps for Mobile Devices ModevUX May 9 2013 mclean VA - @iRajLalDesigning Killer Apps for Mobile Devices ModevUX May 9 2013 mclean VA - @iRajLal
Designing Killer Apps for Mobile Devices ModevUX May 9 2013 mclean VA - @iRajLal
 
Html5 Whats around the bend
Html5 Whats around the bendHtml5 Whats around the bend
Html5 Whats around the bend
 
Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...
Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...
Accessible design with html5 JS Everywhere 2012 Oct 26 Fairmont Hotel San Jos...
 
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
Accessibility on Windows Phone - Windows Phone Meetup at Nokia - 16 October @...
 
Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...
Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...
Accessible design - HOW Interactive Design Conference Washington DC SEPT 27-2...
 
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
Accessible Design with HTML5 - HTML5DevConf.com May 21st San Francisco, 2012 ...
 
Developing Apps for Nokia Windows Phone VSLiv Conference May 15, 2012 @iRajLal
Developing Apps for Nokia Windows Phone  VSLiv Conference May 15, 2012 @iRajLalDeveloping Apps for Nokia Windows Phone  VSLiv Conference May 15, 2012 @iRajLal
Developing Apps for Nokia Windows Phone VSLiv Conference May 15, 2012 @iRajLal
 
Upgrade Your Website to HTML5 - VSLive Conference New York @iRajLal
Upgrade Your Website to HTML5 - VSLive Conference New York  @iRajLalUpgrade Your Website to HTML5 - VSLive Conference New York  @iRajLal
Upgrade Your Website to HTML5 - VSLive Conference New York @iRajLal
 
Honeycomb User Interface Design @iRajLal
Honeycomb User Interface Design @iRajLalHoneycomb User Interface Design @iRajLal
Honeycomb User Interface Design @iRajLal
 
Two thumbs User Interface @iRajLal
Two thumbs User Interface @iRajLalTwo thumbs User Interface @iRajLal
Two thumbs User Interface @iRajLal
 
Angry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLal
Angry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLalAngry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLal
Angry Developer: Creating a Game in QML and JavaScript for MeeGo N9 @iRajLal
 
Fun with QML and JavaScript: Embedded Linux Conference 11th April 2011, Hotel...
Fun with QML and JavaScript: Embedded Linux Conference 11th April 2011, Hotel...Fun with QML and JavaScript: Embedded Linux Conference 11th April 2011, Hotel...
Fun with QML and JavaScript: Embedded Linux Conference 11th April 2011, Hotel...
 

Último

Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 

Último (20)

Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 

Fun with silverlight4 Table of Content @iRajLal

  • 1. Fun with Silverlight 4 Rajesh Lal Illustrated Guide to Creating Rich Internet Applications (with examples in C#, ASP.NET, XAML, Media, Webcam, AJAX, REST and Web Services)
  • 3. Contents at a Glance Introduction ................................................................................................................ 1 Part I Developing Silverlight Applications 1 Design a Rich Internet Application ..........................................................................11 2 Extend Control Framework ......................................................................................69 3 Create Compelling Graphics ................................................................................ 119 4 Work with Animation ............................................................................................. 193 Part II Interact with the Web 5 Extend Browser Programming Model ................................................................... 231 6 Brind Data Visualization to the Web ..................................................................... 295 7 Develop with ASP.NET and AJAX........................................................................ 379 8 Work with Web Services....................................................................................... 413 Part III Advance with Media 9 Play with Media .................................................................................................... 451 10 Fun with Advanced Media .................................................................................... 505 Part IV Appendix 11 Silverlight: A Beginner’s Guide ............................................................................. 559
  • 5. Contents Introduction What’s in the Book 1 Section 1: Develop Silverlight Applications 2 Section 2: Interact with Web 2 Section 3: Advance with Media 3 Part I: Developing Silverlight Applications 1. Design a Rich Internet Application Use Common Controls 11 Use a Grid 11 Use Grid Splitter Control 15 Create Popup Control 18 Work with Stack Panel 20 Use Repeat Button 22 Use ToolTip 25 Create Canvas and Shapes 29 Handle Input and Events 32 Capture Mouse Input 32 Capture Mouse 37 Capture Keyboard Input 42 Use Ink 47 Use Dynamic Resources 52 Load XAML Resource dynamically 52 Load XAML Files dynamically 55 Load XAML Code 56 Load Image file 58 Load Media File 60 Load Audio File 62 Use Fonts 63 2. Extend Control Framework Customize Common Controls 69 Create a Reusable Control 69 Apply Style to the Login Control 71 Use Template with controls 75 Create Rich experience with Visual State Manager 78 Reusable Control 82 Create a Thumbnail User Control 82 Create a Slideshow Custom Control 90 DeepZoom 100 Create Single Image Zoom Application 100 Create Multiple Image Zoom with Information 108
  • 6. Table of Contents 3. Create Compelling Graphics Understand Layout 119 Work with Border 119 Understand Padding 125 Work with Advanced Shapes 127 Work with Lines128 Draw Curves 131 Create Geometry 132 Draw Arcs 135 Create Yin Yan 137 Work with Paintbrushes 139 Create Solid Color Brush 140 Create a Web Safe Palette 143 Use Predefined Colors 145 Work with Linear Gradient Brush 145 Create a Sun Glow effect 148 Work with Linear Gradient Brush 150 Create Gradient for Prism 151 Work with Radial Gradient Brush 153 Work with Radial Gradient 155 Create Sun glow using Radial Gradient 157 Create a Sunrise picture using Radial Gradient 159 Create a Glass Orb 160 Use Media Brush 162 Use Image and Video in a Brush 164 Apply ImageBrush and VideoBrush in a shape 165 Image and Video Bursh on a Control 166 Work with Transformations 168 Use Rotate Transformation 168 Use Scale Transformation 171 Use Skew Transformation 173 Use Translate Transformation 176 Manipulate Image 178 Stretch Image 179 Clip Image 182 Apply Opacity to an Image 184 Shadow Image 186 Glow Image 187 Add Reflection to an Image 189 4. Work with Animation Understanding Animation 193 Use Double Animation 196 Customize the speed of the animation 199 Rotate an Element 201 Create Multiple Animations 202 Create Point Animation 203
  • 7. Create a Solar Eclipse animation 205 Use Point Animation with Gradient 207 Create Color Animation 209 Create a Rainbow with Fade In effect. 214 Understand Keyframe Animation 217 Create Discrete KeyFrame Animation 220 Create Splined KeyFrame Animation 222 Part II: Interacting with the Web 5. Extend Browser Programming Model Get Browser Information 232 Read Query Strings 234 Implement History Navigation 238 Work with Cookies 241 Understand SilverlightHost 244 Access Silverlight Plug-in Values 245 Create Transparent Background 247 Work with Custom Parameters 249 Slideshow Widget with Custom Parameters 251 Create Silverlight Dynamically 254 Use Local Storage 257 Open File Dialog 257 Work with Isolated Store 261 Add Local files to Isolated Store 266 Add embedded files to Isolated Store 271 Work with Isolated Settings 275 Work through HTML Bridge 279 Access Elements in the HTML Page 279 Access Document Object Model (DOM) 283 Access Script on the Page 286 Access Silverlight from the Page 289 6. Bring Data Visualization to Web Know Data 295 Know Array data structures 296 Bind Data with One-Way and Two-Way Binding 311 Work with Data Template 318 Use Data Validation and Conversion 322 Work with XML Data 330 Use XML Reader 331 Create XML using XML Writer 342 Work with XLinq 346 Serialize, De-Serialize XML data 357 Understand JSON Data 360 Consume JSON Data 360 Use JSON Data Contract Serializer 366
  • 8. Table of Contents Work with RSS and Atom feeds 369 Read RSS 2.0 and Atom 1.0 feed 370 Format XML as RSS and Atom 1.0 Feed 373 7. Develop with ASP.NET and AJAX Use Silverlight in ASP.NET 379 Create Silverlight using Server code 380 Work with ASP.NET Silverlight Server Control 381 Work with ASP.NET Media Control 383 Encapsulate Silverlight in ASP.NET User Control 386 Work with ASP.NET AJAX Extension 390 Use ADO.NET Data Services 394 Use ADO.NET Data Services for CREATE Operation 399 Use ADO.NET Data Services for READ Operation 404 Use ADO.NET Data Services for UPDATE Operation 408 Use ADO.NET Data Services for DELETE Operation 410 8. Work with Web Services Interact with REST Web Service 413 Use Silverlight to GET from Flickr REST API 414 Use Silverlight to POST to Twitter REST API 421 Work with ASP.NET Web service (ASMX) 426 Use Silverlight enabled WCF service 433 Develop with .NET/WCF RIA Service 439 Part III: Advance with Media 9. Play with Media Work with Rich Media 451 Create a Rich Video Experience 452 Work with Media State and Full Screen Mode 457 Use Video Brush 463 Learn SetSource and MediaStream 470 Encode and Deliver Media 472 Progressive Download Media 473 Know Media Streaming 475 Smooth Streaming 479 Create Media Markers 483 Add Keywords and Thumbnails Media Markers 483 Add Closed Captioning to a Media 487 Add Chapters List and Subtitles 490 Edit Media 494 Insert Image Before/After Media 494 Embed Image into Media 497 Embed Video into Media (Picture in Picture) 500 Embed XAML into Media 501
  • 9. 10. Fun with Advanced Media Create an Advanced Media Player 505 Custom Media Player with Timeline 506 Use Media Player Object with Media Skins 510 Customize Encoder Media Player 512 Working with Playlists 520 Create Client Side Playlists 520 Work with Web Playlists 524 Create Server-Side Playlists 527 Use Webcam 529 Use Audio Capture to Record Audio 530 Use Webcam to Record Video 535 Take a Screenshot from Silverlight 542 Use Silverlight Media Frameworks (SMF) 545 SMF Simple Media Player 546 SMF Progressive Download Player 549 SMF Smooth Streaming Player 551 Part IV: Appendix 11. Silverlight:A Beginner’s Guide Silverlight Basics 560 Silverlight Plug-in 561 Steps for rendering Silverlight on a web page 562 Silverlight Host 563 Silverlight Application File (.XAP) 564 Silverlight XAML 568 Extensible Markup Language files (Visual Part) 568 XAML .NET Files (Application Part) 572 Silverlight and .NET Framework 574 Understand the Embedded CLR 575 NET Framework Libraries for Silverlight 575 Create Silverlight Application 578 Creating the Hello World Application 578 Create an Event Driven Application 582
  • 11. About the Author Rajesh Lal is passionate about Silverlight and Web technologies. He likes to take a pragmatic approach to solving problems and make extra effort to simplify complex topics. Rajesh has worked on software design and development for more than ten years and had authored multiple books on Windows Gadgets, Web Widgets and Smartphone Web development. He has a Master’s degree in Computer Science from Texas and currently lives in Mountain View, California. Book resources : http://silverlightfun.com Twitter : @rajeshlalnokia Personal website : http://irajesh.com Email : connectrajesh@hotmail.com
  • 13. Technical Reviewers Rick Kingslan is a Senior Technical Writer for the Micro- soft Office division, working on the Lync Server product line developing planning and deployment documenta- tion for customers. Rick worked on the Lync Server 2010 resource kit, as well as the Office Communications Server 2007 R2 and 2007 resource kit books. Prior to taking on the role of a technical writer, he worked as a Consultant, Microsoft Consulting Services (MCS) delivering solutions to enterprise customers. During his tenure with MCS, Rick travelled internationally to 12 countries on four continents, delivering Application Compatibility and Remediation seminars. The training was sponsored by the Windows division in an effort to expedite the transition of customers moving from Windows XP and Server 2003. Rick lives and works in Omaha, Ne (yes, Nebraska IS that large, flat place right between Chicago and Denver…OK, Iowa is there, too.) He is married to Sue. Rick’s blog is “Musings of a Constant Geek” at http://rkingsla.wordpress.com/ Kunal Chowdhury is a Microsoft MVP (Silverlight), a Telerik MVP, a Codeproject MVP & Mentor, Speaker in various Microsoft events, Author, passionate Blogger and a Software Engineer by profession. He has a very good skill over Silverlight, LightSwitch, Windows Phone 7, C#, XAML & Blend. He shares his technical findings, tutorials in his technical blog. Follow his Blog and Facebook page to be updated on latest articles. Technical Blog http://www.kunal-chowdhury.com Silverlight-Zone http://www.silverlight-zone.com Twitter http://twitter.com/kunal2383 Facebook Page https://www.facebook.com/blog.kunal2383
  • 15. Dedication To my wife Lakshmi. Kaise Mujhe Tum Mil Gayee (How did I find you!) Acknowledgement Writing is a fascinating journey, but it is also long and tiring. I would like to extend my special thanks to all my friends and family who supported me during this journey. Specially my mom and dad and my brothers Rakesh and Rajeev, for all the wonderful things I have learned from them, and Simple, and Shilpi for just, being so wonderful, and to my inspiration and my wife Neelu the most beautiful thing happned to me in the last ten years.