Silverlight™ 2 Bible

Book description

Create rich, cross-platform, interactive Web applications with Microsoft's new Silverlight and this essential guide. Designers will discover how to add animation, audio, video, and other high-impact effects. Programmers will cover Visual Studio, .NET, and other programming tools—and work with Silverlight's presentation, communications, and data frameworks. Packed with techniques, tips, and a 16-page color insert of striking examples, this is the book you need to succeed with Silverlight—whether you're a designer or programmer.

Table of contents

  1. Copyright
  2. About the Authors
  3. Credits
  4. Preface
  5. Acknowledgments
  6. Introduction
    1. Who Should Read This Book
    2. How This Book Is Organized
      1. Part I: Silverlight Basics
      2. Part II: Silverlight Design Fundamentals
      3. Part III: Programming Silverlight Applications
      4. Part IV: Understanding Silverlight Frameworks
      5. Part V: Appendixes
    3. How to Get the Most out of This Book
  7. I. Silverlight Basics
    1. 1. Getting to Know Silverlight
      1. 1.1. What Is Silverlight?
      2. 1.2. Why Use Silverlight?
      3. 1.3. Comparing Silverlight 1.0 and 2
      4. 1.4. Silverlight Framework Architecture
        1. 1.4.1. The Silverlight plug-in
        2. 1.4.2. The Silverlight core presentation framework
        3. 1.4.3. The .NET Silverlight framework
        4. 1.4.4. Silverlight application architecture
      5. 1.5. Summary
    2. 2. Getting Started with Silverlight
      1. 2.1. Implementing the Silverlight Development Environment
        1. 2.1.1. Installing Visual Studio 2008
        2. 2.1.2. Installing the Silverlight plug-in
        3. 2.1.3. Installing the Silverlight SDK
        4. 2.1.4. Implementing Silverlight applications on the Linux platform
      2. 2.2. Understanding Silverlight Development Tools
        1. 2.2.1. Using Silverlight in Visual Studio 2008
        2. 2.2.2. Designing Silverlight applications and elements in Expression Blend
        3. 2.2.3. Encoding Silverlight media elements in Expression Encoder
        4. 2.2.4. Outputting vector images as XAML using Expression Design
        5. 2.2.5. Encoding Multiscale Images Using Deep Zoom Composer
      3. 2.3. Building Your First Silverlight Application
      4. 2.4. Summary
  8. II. Silverlight Design Fundamentals
    1. 3. Using XAML to Build Declarative Silverlight Applications
      1. 3.1. Understanding the Silverlight/XAML Relationship
      2. 3.2. Understanding XML Namespaces
      3. 3.3. Creating Silverlight Controls
        1. 3.3.1. Creating a Button
        2. 3.3.2. Creating a Calendar
        3. 3.3.3. Creating a CheckBox
        4. 3.3.4. Creating a DatePicker
        5. 3.3.5. Creating a HyperlinkButton
        6. 3.3.6. Creating an Image
        7. 3.3.7. Creating a ListBox
        8. 3.3.8. Creating a MediaElement
        9. 3.3.9. Creating a RadioButton
        10. 3.3.10. Creating a ScrollBar
        11. 3.3.11. Creating a ScrollViewer
        12. 3.3.12. Creating a Slider
        13. 3.3.13. Creating a TextBlock
        14. 3.3.14. Creating a TextBox
        15. 3.3.15. Creating a ToggleButton
      4. 3.4. Designing the Layout of Silverlight Applications
        1. 3.4.1. Using a Canvas control
        2. 3.4.2. Using a Grid control
        3. 3.4.3. Using a TabControl control
        4. 3.4.4. Using a StackPanel control
        5. 3.4.5. Using a Border control
      5. 3.5. Using XAML Transforms
        1. 3.5.1. ScaleTransform
        2. 3.5.2. RotateTransform
        3. 3.5.3. SkewTransform
        4. 3.5.4. TranslateTransform
        5. 3.5.5. Opacity
      6. 3.6. Drawing
        1. 3.6.1. Creating a Rectangle
        2. 3.6.2. Creating an Ellipse
        3. 3.6.3. Creating a Path
      7. 3.7. Using XAML Brushes
        1. 3.7.1. Adding a SolidColorBrush
        2. 3.7.2. Adding a LinearGradientBrush
        3. 3.7.3. Adding a RadialGradientBrush
        4. 3.7.4. Adding an ImageBrush
        5. 3.7.5. Adding a VideoBrush
      8. 3.8. Implementing Animations and Storyboards
        1. 3.8.1. Defining Storyboard controls
        2. 3.8.2. Starting animations upon page load
        3. 3.8.3. Creating From/To animations
        4. 3.8.4. Creating Key Frame animations
        5. 3.8.5. Creating animations as Resources
      9. 3.9. Attaching Event Handlers to XAML Elements
      10. 3.10. Summary
    2. 4. Using Expression Blend to Design Silverlight Applications
      1. 4.1. Getting Started with Expression Blend
        1. 4.1.1. Creating a Silverlight application project in Expression Blend
        2. 4.1.2. Using the Design, XAML, and Split views
        3. 4.1.3. Understanding the Expression Blend Toolbox
        4. 4.1.4. Adding Silverlight controls
      2. 4.2. Arranging Controls in the Design View
        1. 4.2.1. Using snaplines and gridlines
        2. 4.2.2. Aligning controls
        3. 4.2.3. Nesting controls using layout panels
        4. 4.2.4. Ordering controls
      3. 4.3. Modifying the Properties of Silverlight Controls
        1. 4.3.1. Naming the control
        2. 4.3.2. Attaching event handlers to controls
        3. 4.3.3. Applying brushes to controls
        4. 4.3.4. Setting appearance properties of controls
        5. 4.3.5. Setting the layout of controls in the Silverlight application
        6. 4.3.6. Applying transforms to controls
        7. 4.3.7. Modifying other control properties
      4. 4.4. Creating Storyboards and Animations in Expression Blend
        1. 4.4.1. Creating a Storyboard
        2. 4.4.2. Animating Silverlight controls in a Storyboard timeline
        3. 4.4.3. Playing animations in Expression Blend
        4. 4.4.4. Recording and modifying key frames
      5. 4.5. Importing Vector Images Using Expression Design and Expression Blend
        1. 4.5.1. Exporting XAML from Expression Design
        2. 4.5.2. Adding exported XAML to a Silverlight application
      6. 4.6. Summary
    3. 5. Encoding Audio, Video, and Images for Silverlight Applications
      1. 5.1. Configuring Video in a Job
        1. 5.1.1. Importing audio and video into Expression Encoder
        2. 5.1.2. Using the timeline controls to cut audio or video
      2. 5.2. Configuring Audio and Video Encode Settings
        1. 5.2.1. Configuring an encoded media file profile
        2. 5.2.2. Configuring a video profile for display in Silverlight
        3. 5.2.3. Setting audio and video preprocessing options
      3. 5.3. Encoding Metadata in the Media File
        1. 5.3.1. Adding metadata
        2. 5.3.2. Adding timeline markers to video
        3. 5.3.3. Adding script commands to a video file
      4. 5.4. Configuring Silverlight Output
        1. 5.4.1. Generating a thumbnail
        2. 5.4.2. Specifying a template
        3. 5.4.3. Modifying the template in Expression Blend
        4. 5.4.4. Specifying output options
      5. 5.5. Implementing Encoded Media in Silverlight Applications
        1. 5.5.1. Understanding encoded output
        2. 5.5.2. Using the encoded output in a Silverlight application
      6. 5.6. Encoding Multiscale Images Using Deep Zoom Composer
        1. 5.6.1. Importing Images into Deep Zoom Composer
        2. 5.6.2. Arranging Images in Deep Zoom Composer
        3. 5.6.3. Exporting Multiscale Images from Deep Zoom Composer
        4. 5.6.4. Understanding the Exported Multiscale Image Project
      7. 5.7. Summary
  9. III. Programming Silverlight Applications
    1. 6. Using Visual Studio to Program Silverlight Applications
      1. 6.1. Developing a .NET Silverlight Application in Visual Studio
        1. 6.1.1. Creating a Silverlight project
        2. 6.1.2. Adding Silverlight controls
        3. 6.1.3. Naming Silverlight controls
        4. 6.1.4. Adding event handlers to Silverlight controls
        5. 6.1.5. Testing Silverlight applications in Visual Studio
      2. 6.2. Using IntelliSense
      3. 6.3. Using the Solution Explorer
        1. 6.3.1. Switching to Expression Blend
        2. 6.3.2. Adding resources
        3. 6.3.3. Build settings
      4. 6.4. Summary
    2. 7. Creating .NET Silverlight Applications
      1. 7.1. Understanding the Anatomy of a .NET Silverlight Application
        1. 7.1.1. Application assembly package
        2. 7.1.2. Implementing library assemblies
        3. 7.1.3. Using resource files
      2. 7.2. Implementing the Application Class
        1. 7.2.1. Application class methods
        2. 7.2.2. Displaying the application UI
        3. 7.2.3. Using initialization parameters
      3. 7.3. Deploying .NET Silverlight Applications in Web Pages
        1. 7.3.1. Embedding a Silverlight plug-in in an HTML Web page
        2. 7.3.2. Embedding a Silverlight application using the asp:Silverlight tag
      4. 7.4. Summary
    3. 8. Programming .NET Silverlight Applications
      1. 8.1. Manipulating XAML Elements Programmatically
        1. 8.1.1. Accessing namescoped XAML elements
        2. 8.1.2. Modifying existing Silverlight XAML elements
        3. 8.1.3. Dynamically adding/removing XAML elements
      2. 8.2. Implementing Event Handling
        1. 8.2.1. Application events
        2. 8.2.2. Silverlight control events
        3. 8.2.3. Mouse events
        4. 8.2.4. Keyboard events
        5. 8.2.5. Media events
        6. 8.2.6. Other control events
      3. 8.3. Controlling Animations Programmatically
        1. 8.3.1. Starting and stopping the animation
        2. 8.3.2. Handling the animation completed event
        3. 8.3.3. Dynamically creating animations in code
      4. 8.4. Implementing Multiscale Images in Silverlight Applications
      5. 8.5. Summary
    4. 9. Programming Silverlight Applications with JavaScript
      1. 9.1. Understanding the Silverlight-JavaScript Relationship
        1. 9.1.1. Managed JavaScript versus unmanaged JavaScript
        2. 9.1.2. Using the Silverlight.js library
      2. 9.2. Creating and Embedding the Silverlight Application
        1. 9.2.1. Configuring parameters of the createObject and createObjectEx functions
        2. 9.2.2. Creating the Silverlight object in a separate JavaScript file
      3. 9.3. Accessing XAML Using Unmanaged JavaScript
        1. 9.3.1. Accessing the Silverlight object
        2. 9.3.2. Accessing the Silverlight application settings
        3. 9.3.3. Accessing XAML content
      4. 9.4. Implementing Event Handling in Unmanaged JavaScript
      5. 9.5. Dynamically Loading Content in Unmanaged JavaScript
        1. 9.5.1. Understanding the Downloader object
        2. 9.5.2. Dynamically loading XAML
        3. 9.5.3. Dynamically loading text and media
      6. 9.6. Summary
    5. 10. Programming Silverlight Applications with ASP.NET Services and AJAX
      1. 10.1. Creating an ASP.NET Web Service to Use Silverlight
        1. 10.1.1. Creating an ASP.NET Web application
        2. 10.1.2. Registering the Silverlight assembly
        3. 10.1.3. Adding a ScriptManager
        4. 10.1.4. Embedding an asp:Silverlight tag in an ASP.NET Web page
        5. 10.1.5. Creating a Web service
        6. 10.1.6. Adding Web methods to the ASP.NET Web service
      2. 10.2. Creating a Silverlight Application for ASP.NET Web Services
        1. 10.2.1. Linking a Silverlight application to an ASP.NET Web application
        2. 10.2.2. Adding a service reference to the Silverlight application
        3. 10.2.3. Accessing an ASP.NET Web service from Silverlight
      3. 10.3. Using asp: MediaPlayer AJAX Element to Directly Embed Video
        1. 10.3.1. Registering the Silverlight assembly
        2. 10.3.2. Adding a ScriptManager
        3. 10.3.3. Embedding an asp:MediaPlayer tag in an ASP.NET Web page
        4. 10.3.4. Adding MediaChapters controls
        5. 10.3.5. Encoding video for AJAX scripting
        6. 10.3.6. Adding an AJAX-enabled WCF service
        7. 10.3.7. Implementing marker events in AJAX
      4. 10.4. Summary
    6. 11. Programming Silverlight Applications Using the Dynamic Language Runtime
      1. 11.1. Configuring a Silverlight DLR Application
        1. 11.1.1. Embedding a Silverlight DLR application in a Web page
        2. 11.1.2. Building the AppManifest.xml file
      2. 11.2. Using Chiron
        1. 11.2.1. Using Chiron as a Web server to test applications
        2. 11.2.2. Creating an XAP file
      3. 11.3. DLR Console on the Web
      4. 11.4. Creating an IronPython Silverlight Application
        1. 11.4.1. Creating XAML for the IronPython Silverlight application
        2. 11.4.2. Creating a manifest for the IronPython Silverlight application
        3. 11.4.3. Providing access to CLR libraries and namespaces in Python
        4. 11.4.4. Accessing XAML from IronPython
        5. 11.4.5. Implementing event handling in IronPython
        6. 11.4.6. Adding dynamic XAML using IronPython
        7. 11.4.7. Example of an IronPython Silverlight application
      5. 11.5. Creating an IronRuby Silverlight Application
        1. 11.5.1. Creating XAML for the IronRuby Silverlight application
        2. 11.5.2. Creating a manifest for the IronRuby Silverlight application
        3. 11.5.3. Providing access to CLR libraries and namespaces in IronRuby
        4. 11.5.4. Accessing XAML from IronRuby
        5. 11.5.5. Implementing event handling in IronRuby
        6. 11.5.6. Adding dynamic XAML using IronRuby
        7. 11.5.7. Example of an IronRuby Silverlight application
      6. 11.6. Creating a Managed JavaScript Silverlight Application
        1. 11.6.1. Creating XAML for the managed JavaScript Silverlight application
        2. 11.6.2. Creating a manifest for the managed JavaScript Silverlight application
        3. 11.6.3. Providing access to CLR libraries and namespaces in managed JavaScript
        4. 11.6.4. Accessing XAML from managed JavaScript
        5. 11.6.5. Implementing event handling in managed JavaScript
        6. 11.6.6. Adding dynamic XAML using managed JavaScript
        7. 11.6.7. Example of a managed JavaScript Silverlight application
      7. 11.7. Summary
    7. 12. Programming Custom Silverlight Controls and Libraries
      1. 12.1. Creating Custom Silverlight Controls in Applications
        1. 12.1.1. Creating a custom User Control in a Visual Studio project
        2. 12.1.2. Creating the custom control UI
        3. 12.1.3. Coding the functionality
        4. 12.1.4. Implementing the custom control in the project
        5. 12.1.5. Example of implementing a custom Silverlight User Control
      2. 12.2. Creating Silverlight Class Library Controls
        1. 12.2.1. Creating the Silverlight library
        2. 12.2.2. Defining the UI for the custom control
        3. 12.2.3. Implementing the custom control functionality
        4. 12.2.4. Example of a custom control Silverlight class library
      3. 12.3. Adding a Silverlight Class Library Control to an Application
      4. 12.4. Summary
  10. IV. Understanding Silverlight Frameworks
    1. 13. Using the Silverlight Presentation Framework
      1. 13.1. Understanding the Silverlight Presentation Framework
      2. 13.2. Interacting with the HTML DOM
        1. 13.2.1. Accessing the HTML DOM from managed code
        2. 13.2.2. Accessing managed code from HTML JavaScript
      3. 13.3. Accessing the Local File System from Silverlight Applications
        1. 13.3.1. Using the operating system's native open for read-only
        2. 13.3.2. Accessing the isolated local storage
      4. 13.4. Implementing Threading in Silverlight Applications
        1. 13.4.1. Implementing a timer thread
        2. 13.4.2. Adding background threads to Silverlight applications
      5. 13.5. Summary
    2. 14. Using the Silverlight Communication Framework
      1. 14.1. Enabling Network Security Access for Silverlight Applications
      2. 14.2. Using a WebClient to Download Resources on Demand
        1. 14.2.1. Using a WebClient to download a text file
        2. 14.2.2. Using a WebClient to download and access a ZIP package
      3. 14.3. Accessing RSS Services
      4. 14.4. Implementing Sockets in Silverlight Applications
        1. 14.4.1. Opening a socket to a remote host
        2. 14.4.2. Sending data on a socket
        3. 14.4.3. Receiving data from a socket
        4. 14.4.4. Closing a socket
        5. 14.4.5. Example of a Silverlight socket application
      5. 14.5. Using the HttpWebRequest and HttpWebResponse Objects
        1. 14.5.1. Using the HttpWebRequest to send requests
        2. 14.5.2. Using the HttpWebResponse class to handle responses
        3. 14.5.3. Example of using HttpWebRequest and HttpWebResponse to send POST data
      6. 14.6. Summary
    3. 15. Using the Silverlight Data Framework
      1. 15.1. Using XmlReader and XmlWriter
        1. 15.1.1. Implementing XmlReader to parse XML data
        2. 15.1.2. Implementing XmlWriter to write XML data
        3. 15.1.3. Example: Reading and writing XML data in memory
      2. 15.2. Serializing a Data Object into XML
        1. 15.2.1. Serializing objects into XML
        2. 15.2.2. Deserializing objects from serialized XML
        3. 15.2.3. Example: Serializing and deserializing XML data in isolated storage
      3. 15.3. Implementing Data Binding in Silverlight Applications
      4. 15.4. Implementing a DataGrid Control
      5. 15.5. Using LINQ in Silverlight to Query SQL Databases
        1. 15.5.1. Creating a Web server Silverlight application project that accesses SQL using LINQ
        2. 15.5.2. Setting up the Silverlight project to use the LINQ service
      6. 15.6. Summary
  11. V. Appendixes
    1. A. Silverlight Resources
    2. B. Silverlight Control Reference
      1. A.1. Border
      2. A.2. Button
      3. A.3. Calendar
      4. A.4. Canvas
      5. A.5. CheckBox
      6. A.6. DataGrid
      7. A.7. DatePicker
      8. A.8. DoubleAnimation
      9. A.9. DoubleAnimationUsingKeyFrames
      10. A.10. DoubleKeyFrame
      11. A.11. Ellipse
      12. A.12. Grid
      13. A.13. GridSplitter
      14. A.14. HyperlinkButton
      15. A.15. Image
      16. A.16. Line
      17. A.17. ListBox
      18. A.18. MediaElement
      19. A.19. MultiScaleImage
      20. A.20. Path
      21. A.21. RadioButton
      22. A.22. Rectangle
      23. A.23. RepeatButton
      24. A.24. ScrollBar
      25. A.25. ScrollViewer
      26. A.26. Slider
      27. A.27. SplineDoubleKeyFrame
      28. A.28. Storyboard
      29. A.29. StackPanel
      30. A.30. TextBlock
      31. A.31. TextBox
      32. A.32. ToggleButton

Product information

  • Title: Silverlight™ 2 Bible
  • Author(s): Brad Dayley, Lisa DaNae Dayley
  • Release date: October 2008
  • Publisher(s): Wiley
  • ISBN: 9780470375006