| Contents at a Glance | 5 |
|---|
| Table of Contents | 6 |
|---|
| About the Author | 22 |
|---|
| About the Technical Reviewer | 23 |
|---|
| Acknowledgments | 24 |
|---|
| Introduction | 25 |
|---|
| Understanding Silverlight | 25 |
| About This Book | 32 |
| The Last Word | 34 |
| CHAPTER 1 Introducing Silverlight | 35 |
|---|
| Silverlight Design Tools | 35 |
| Visual Studio vs. Expression Blend | 36 |
| Understanding Silverlight Websites | 37 |
| Creating a Stand-Alone Silverlight Project | 38 |
| Creating a Simple Silverlight Page | 41 |
| Adding Event Handling Code | 43 |
| Testing a Silverlight Application | 45 |
| Creating an ASP.NET-Hosted Silverlight Project | 46 |
| ASP.NET Controls That Render Silverlight Content | 50 |
| Mixing ASP.NET Controls and Silverlight Content | 51 |
| Silverlight Compilation and Deployment | 51 |
| Compiling a Silverlight Application | 51 |
| Deploying a Silverlight Application | 53 |
| Silverlight Core Assemblies | 55 |
| Silverlight Add-On Assemblies | 56 |
| Assembly Caching | 56 |
| The HTML Entry Page | 58 |
| Sizing the Silverlight Content Region | 60 |
| Silverlight Parameters | 60 |
| Alternative Content | 62 |
| Creating a Friendly Install Experience | 62 |
| The Mark of the Web | 63 |
| The Last Word | 65 |
| CHAPTER 2 XAML | 66 |
|---|
| XAML Basics | 67 |
| XAML Namespaces | 67 |
| Core Silverlight Namespaces | 68 |
| Design Namespaces | 69 |
| Custom Namespaces | 70 |
| The Code-Behind Class | 71 |
| Naming Elements | 72 |
| Properties and Events in XAML | 72 |
| Simple Properties and Type Converters | 74 |
| Complex Properties | 75 |
| Attached Properties | 77 |
| Nesting Elements | 78 |
| Events | 81 |
| The Full Eight Ball Example | 82 |
| XAML Resources | 83 |
| The Resources Collection | 83 |
| The Hierarchy of Resources | 85 |
| Accessing Resources in Code | 86 |
| Organizing Resources with Resource Dictionaries | 87 |
| Element-to-Element Binding | 89 |
| One-Way Binding | 89 |
| Two-Way Binding | 91 |
| The Last Word | 92 |
| CHAPTER 3 Layout | 93 |
|---|
| The Layout Containers | 93 |
| The Panel Background | 95 |
| Borders | 97 |
| Simple Layout with the StackPanel | 98 |
| Layout Properties | 100 |
| Alignment | 101 |
| Margins | 102 |
| Minimum, Maximum, and Explicit Sizes | 104 |
| The WrapPanel and DockPanel | 106 |
| The WrapPanel | 107 |
| The DockPanel | 108 |
| The Grid | 110 |
| Fine-Tuning Rows and Columns | 112 |
| Nesting Layout Containers | 113 |
| Spanning Rows and Columns | 115 |
| The GridSplitter | 116 |
| Coordinate-Based Layout with the Canvas | 119 |
| Layering with ZIndex | 121 |
| Clipping | 121 |
| Custom Layout Containers | 123 |
| The Two-Step Layout Process | 123 |
| MeasureOverride() | 123 |
| ArrangeOverride() | 125 |
| The UniformGrid | 126 |
| Sizing Pages | 131 |
| Scrolling | 133 |
| Scaling | 135 |
| Full Screen | 137 |
| The Last Word | 138 |
| CHAPTER 4 Dependency Properties and Routed Events | 140 |
|---|
| Dependency Properties | 140 |
| Defining and Registering a Dependency Property | 141 |
| Dynamic Value Resolution | 143 |
| Attached Properties | 144 |
| The WrapBreakPanel Example | 145 |
| Routed Events | 148 |
| The Core Element Events | 148 |
| Event Bubbling | 151 |
| Handled (Suppressed) Events | 152 |
| An Event Bubbling Example | 153 |
| Mouse Movements | 156 |
| The Mouse Wheel | 156 |
| Capturing the Mouse | 158 |
| A Mouse Event Example | 159 |
| Mouse Cursors | 162 |
| Key Presses | 163 |
| Key Modifiers | 165 |
| Focus | 166 |
| The Last Word | 166 |
| CHAPTER 5 Elements | 168 |
|---|
| The Silverlight Elements | 168 |
| Static Text | 172 |
| Font Properties | 174 |
| Standard Fonts | 175 |
| Font Embedding | 176 |
| Underlining | 177 |
| Runs | 178 |
| Wrapping Text | 179 |
| Images | 179 |
| Image Sizing | 180 |
| Image Errors | 181 |
| Content Controls | 182 |
| The Content Property | 183 |
| Aligning Content | 185 |
| Buttons | 186 |
| The HyperlinkButton | 186 |
| The ToggleButton and RepeatButton | 187 |
| The CheckBox | 188 |
| The RadioButton | 188 |
| Tooltips and Pop-Ups | 189 |
| Customized ToolTips | 190 |
| The Popup | 192 |
| Items Controls | 193 |
|
|