List of Figures

Chapter 1. Introducing Silverlight

Figure 1.1. Calculated frames per second, per technology, per platform, and per browserThe Internet Explorer and Firefox statistics were compiled using a freshly formatted Dell Inspiron 6000 with an Intel Pentium M 2.00 GHz processor, 1GB of RAM, and Windows XP (SP2) installed. The Safari statistics were compiled using an Apple MacPro 2.66 GHz DuoCore processor with 2GB of RAM. These tests, along with source code, are available at http://www.bubblemark.com.

Figure 1.2. Silverlight supports the platforms listed. The Other portion represents the platforms that Silverlight doesn’t support.

Figure 1.3. Silverlight content can run within the browsers and versions listed within the chart. The Other portion represents the browsers not supported by Silverlight or Moonlight.

Figure 1.4. The tiers of a web page

Figure 1.5. Designer/Developer work distribution

Figure 1.6. Another Designer/Developer work distribution viewpoint

Figure 1.7. Any object that you create in XAML can also be created within code.

Figure 1.8. The relationship between an XAML file and a code-behind file within a C# project

Figure 1.9. The finished product of this “Blending it together” session

Chapter 2. Harmony with the web

Figure 2.1. Two theoretical uses of Silverlight. The shaded areas represent Silverlight applications. These applications are part of a web property.

Figure 2.2. The darkly shaded area represents the HTML DOM. The lightly shaded area represents the Silverlight control. This control hosts the Silverlight Object Model.

Figure 2.3. The order in which the Silverlight Object Model renders content

Snippet 2.2. HTML: Instantiating the Silverlight control

Snippet 2.3. HTML: The initialization properties used by createObjectEx

Figure 2.4. The consequences of various background and isWindowless property combinations. The outermost rectangle represents a section of HTML within a web page. The inner rectangle represents the region occupied by a Silverlight plug-in. The rounded rectangle is the pure Silverlight content that will be explained later.

Figure 2.5. The Silverlight installation prompt

Figure 2.6. The Silverlight Configuration dialog box. This dialog box is accessible by right-clicking Silverlight content within a web browser.

Snippet 2.5. HTML: Registering events associated with a plug-in instance

Figure 2.7. The structure of a .xap file

Snippet 2.10. C#: A sample Startup event handler

Figure 2.8. The elements of a web address

Chapter 3. Back to the basics: Layout and text

Snippet 3.4. C#: Changing the position of an element at runtime

Figure 3.1. A sample crossword puzzle

Figure 3.2. A basic purchase order

Snippet 3.10. XAML Result: The basic syntax of a Grid

Snippet 3.11. XAML Result: Arranging content within a Grid

Snippet 3.14. XAML Result: A basic Grid using star sizing.

Snippet 3.15. XAML Result: A basic Grid using auto sizing

Snippet 3.20. XAML Result: The basic syntax and usage of a GridSplitter

Figure 3.3. A sampling of the font families supported within Silverlight

Figure 3.4. The formula to convert font points to pixels in Silverlight

Snippet 3.30. XAML Result: The relationship between the FontSize and LineHeight properties

Figure 3.5. An example of the Opacity property

Figure 3.6. The figure on the left represents a page that displays a grid. This grid contains several items from the periodic table of elements. A user can click an element to retrieve its details, which are displayed on another page. This page is shown on the right side of the figure.

Snippet 3.36. XAML Result: Demonstrating the various VerticalAlignment and HoriztonalAlignment options

Snippet 3.38. C# XAML: Moving a TextBlock 5 pixels at a time by using the GetValue and SetValue methods

Chapter 4. Handling user interaction

Snippet 4.4. C#: The mouse-related event handlers for implementing drag-and-drop

Figure 0.1. The text selection parts

Snippet 4.11. XAML Result: Manually controlling RadioButton groupings

Snippet 4.24. XAML Result: A basic Popup

Snippet 4.29. C#: Beginning to construct the Stroke. This class is defined in the System.Windows.Ink namespace.

Snippet 4.30. C#: Adding to the Stroke through the MoveMove event

Chapter 5. Getting down with data binding

Figure 5.1. A conceptual view of data binding.

Snippet 5.1. C# XAML: Adding a Binding to a TextBox from C#

Figure 5.2. A conceptual view of OneTime binding to a data source

Figure 5.3. A conceptual view of OneWay binding to a data source

Figure 5.4. A conceptual view of TwoWay binding to a data source

Snippet 5.5. C# XAML: Binding an Emoticon object (defined in snippet 5.4) to a Grid

Snippet 5.8. C#: A sample value converter. This converter changes a bool to Yes or No and back again.

Snippet 5.13. C# XAML Result: A basic DataGrid. Assume that the ItemsSource property is set in the code behind.

Snippet 5.15. XAML Result: Using the RowDetailsTemplate. This DataTemplate shows the keyboard shortcut for an emoticon.

Figure 5.5. LINQ enables you to seamlessly integrate disparate data types through managed code.

Snippet 5.17. C# XAML Result: A basic LINQ query over an array of strings

Snippet 5.18. C# XAML Result: Deferred querying in action

Chapter 6. Networking and communications

Snippet 6.3. C# XAML Result: Calling a simple SOAP service

Snippet 6.5. C# Service: Using complex data types with SOAP service

Snippet 6.7. C#: Getting data from a REST service

Chapter 7. Managing digital media

Snippet 7.3. C# XAML: An example that shows the percentage of content ready for use within a MediaElement

Snippet 7.4. C#: An example that shows the NaturalDuration of a MediaElement

Figure 7.1. The cycle of events as a media item plays progressively within a MediaElement

Figure 7.2. The difference between embedded and full-screen modes

Figure 7.3. The prompt displayed to users when they enter full-screen mode

Figure 7.4. A user requests protected content from a server. This content is downloaded, in encrypted format, to the Silverlight application.

Figure 7.5. The process of installing the content access components. This one-time process happens the first time a user attempts to use a protected item. Future attempts to access protected content won’t go through the process of downloading and installing PlayReady.

Figure 7.6. The media content in this figure is locked until a key is retrieved from the licensing server. This server can implement some custom logic through the PlayReady SDK.

Snippet 7.15. C#: Implementing a zoom functionality. A zoom-out will occur if the user presses Shift and clicks the MultiScaleImage. If the user presses Shift and clicks the MultiScaleImage, a zoom-out will occur.

Figure 7.7. A MultiScaleImage with a ViewportWidth of 0.33

Figure 7.8. The boundary of an Image element in comparison to the actual size of the photo

Chapter 8. Getting a grip on graphics

Snippet 8.8. XAML Result Type: An open shape compared to a closed shape

Figure 8.1. The Brush coordinate space

Figure 8.2. The end result of this Blending it Together section.

Chapter 9. Bringing it to life: Animation

Figure 9.1. An image fading into view over the course of one second

Snippet 9.1. XAML: XAML for fading in an Image over course of one second

Snippet 9.2. XAML: The XAML for a basic Ellipse

Figure 9.2. The effects of the SpeedRatio on a Timeline with a Duration of 10 seconds.

Figure 9.3. The effects of the RepeatBehavior on a Timeline with a Duration of 10 seconds.

Snippet 9.14. XAML: Animation overriding target of its parent Storyboard

Figure 9.4. The daisy-chaining syntax in action

Snippet 9.16. C# XAML: An animation that uses the playback methods and the Completed event

Snippet 9.17. XAML: Defining a Storyboard as a resource Snippet

Figure 9.5. A bouncing ball over some variable amount of time

Figure 9.6. How linear interpolation is determined

Figure 9.7. An example using spline interpolation for approximation

Figure 9.8. The relationship between time and value as used by the KeySpline property. In this figure,

Figure 9.9. Sample time/value curves used by the KeySpline property

Figure 9.10. An example using discrete interpolation for approximation

Snippet 9.23. XAML Result: Using a TimeSpan value to specify the KeyTime. Each car represents the location of the image when the key frame is reached.

Chapter 10. Giving it style

Snippet 10.1. XAML Result: The basic syntax and usage of a resource

Figure 10.1. A sample website project structure. Notice the four .png files.

Figure 10.2. How to define a file as a content file. When it’s compiled, a content file is added to a .xap file.

Snippet 10.13. XAML Result: A basic Style definition. The text in the TextBox is entered at runtime.

Snippet 10.14. XAML Result: An example of using a complex property value as part of a Style definition. This snippet builds on snippet 10.13. The text in the result is entered at runtime.

Snippet 10.16. XAML Result: Changing the look of a Button through a Template

Snippet 10.17. XAML Result: Using a TemplateBinding to use the target elements properties

Snippet 10.21. XAML Result: Using a ControlTemplate within a Style

Figure 10.3. The parts of a Slider

Snippet 10.22. XAML: Creating a Button that enlarges when a user hovers over it

Snippet 10.23. XAML: Creating a Button that transitions when a user hovers, or leaves, it

Chapter 11. Enhancing the experience

Figure 11.1. An illustration of a potential isolated storage area

Snippet 11.7. C# XAML Result: Creating a file quota bar associated with the user’s isolated storage area

Snippet 11.9. C#: Creating a file within a user’s isolated storage area

Snippet 11.10. C#: Reading a file from a user’s isolated storage area. The contents of the file are shown through a pretend TextBlock.

Snippet 11.14. C#: Implementing the DoWork event

Snippet 11.15. C# Reporting progress changes from the BackgroundWorker

Snippet 11.16. C#: Canceling a BackgroundWorker when a user selects the Escape key

Snippet 11.17. C#: Handling the completion of the background task

Snippet 11.18. C#: Requesting some string content through the WebClient object

Snippet 11.25. C#: Loading an image from a compressed package that was retrieved on demand

Snippet 11.26. C#: Dynamically retrieving an application module

Snippet 11.28. C#: The complete class library in C#

Figure 11.2. The typical development approach using a language like C#

Figure 11.3. A possible development approach using metaprogramming

Chapter 12. Share the light: Distribution and deployment

Figure 12.1. A TextBox that can be locked

Snippet 12.1. XAML: The user interface for the LockableTextBox UserControl

Snippet 12.2. c#: The LockableTextBox class definition

Figure 12.2. The architecture for providing navigation

Snippet 12.7. c#: The definition of the NavigationService class

Snippet 12.10. XAML Result: The XAML for a custom splash screen. Assume this XAML is stored in a file called splash.xaml.

Snippet 12.11. JavaScript: The createObjectEx function call that associates a splash screen with Silverlight application

Snippet 12.12. JavaScript: The event handlers used for monitoring the download progress of a .xap file

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset