Appendix

WPF AND SILVERLIGHT RESOURCES

If you like what you have learned thus far and want to keep on developing in WPF and/or Silverlight, I suggest you keep this list of resources handy. You never know when you will need to take a look at the documentation to learn about a certain class. Or you may just want to keep up on the latest and greatest with some great blogs. Or possibly you just want to take more tutorials. Finally, maybe you are in the middle of a WPF/Silverlight application and you are stuck on a prob- lem; the forums are a great place to turn for help. As this information may change over time, you can view the same information updated on my book’s web site, www. windowspresentationfoundation.com.

References MSDN Windows Presentation Foundation: This is the place to find the docu- mentation for all of WPF. http://msdn2.microsoft.com/en-us/library/ms754130.aspx

Silverlight homepage: This site is a great place to find everything Silverlight. http://silverlight.net/

333 APPENDIX

WPF FAQ Index: Here, you’ll get answers to frequently asked questions about WPF. http://wpfwiki.com/WPF%20FAQ%20Index.ashx

MSDN Windows Presentation Foundation (Avalon) FAQ: This is another good site for getting answers to frequently asked questions about WPF. http://msdn2.microsoft.com/en-us/windowsvista/aa905016.aspx

Blogs Beatriz Costa: If you are looking for great WPF insight, sample code, and sample projects, this site is for you. www.beacosta.com/blog/

IRhetoric: This is the blog of Karsten Januszewski, a Technical Evangelist for Microsoft, and it’s a great site for all things WPF and Silverlight. http://rhizohm.net/irhetoric/

Tim Sneath: Tim is a Group Manager for Microsoft. His blog also has great WPF and Silverlight resources. http://blogs.msdn.com/tims/

The WPF Blog: This is the blog of Lee Brimelow. Although Lee has recently moved away from WPF development and back to Flash, his blog has an archive of wonderful articles and tutorials. www.thewpfblog.com/

Tutorials ContentPresenter: Here you’ll find some really great WPF tutorials from Lee Brimelow. www.contentpresenter.com/

Lynda: This is a pay site, but it has some very good Expression Blend and Silverlight tutorials. You can start to take the first few lessons for free. If you like the tutorials, you can subscribe. http://lynda.com/

Silverlight homepage: There are some very cool video tutorials here for Silverlight 2.0 and 1.0 if you are interested. http://silverlight.net/Learn/videocat.aspx?cat=2

334 WPF AND SILVERLIGHT RESOURCES

Tools Blendables—Tools and Components for Designers and Developers: If you plan on doing WPF development professionally, save yourself a lot of time and headaches by checking out this set of tools. http://blendables.com/

Community sites The MSDN Silverlight Community: If you get stuck with Silverlight, this site is the place to go to ask questions and get answers, oftentimes from Microsoft developers themselves! http://msdn2.microsoft.com/en-us/silverlight/bb187454.aspx

The Silverlight Forums: Here you’ll find more Silverlight forums to help you solve your Silverlight issues. http://silverlight.net/forums/

The MSDN WPF Forums: These forums are dedicated to everything WPF. http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=119&SiteID=1

ExpressionBlend.com: You’ll find Blend forums at this site. http://expressionblend.com/forums/default.aspx

MSDN Visual Studio Setup and Installation: If you are having trouble installing Visual Studio, check this site out. http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=26&SiteID=1

Professional WPF/Silverlight development resources IdentityMine: This is the site for the leading development house for WPF and Silverlight and a Gold Vendor for Microsoft. If you need professional WPF Silverlight development, they are the ones to contact. www.identitymine.com/

335 INDEX

Numbers and symbols 3DPlane Window.Resource + button, adding new action with, 45 adding 3D Tools code to, 240 + Event button, creating new event, 43, 286 binding Interactive3D namespace to, +Brush button, creating color resource with, 240–241 70–71 3DTieFighterProject +CLR Object, adding a DataSource with, 276 Case Study B, 293–307 - (minus) icon, 297 cleaning XAML for, 296–297 3D and WPF, 207–244 creating, 295–307 3D animation vendors, adoption of OBJ file creating and naming Ellipses buttons, format by, 227 297–298 3D box stripping animations and Triggers from, 297 adding easing to, 288–289 styling the background, 302 adding new event to, 286 creating, 283–284 A spinning, 286–290 Abstract factory pattern, creating 3D objects ObservableCollections with, 191–197 building for placing VideoUserControl, 239 Add CLR Object Data Source dialog box, creating with third-party software, 212–220 creating a DataSource in, 276 exporting to pull into Blend 2, 217–220 Add Existing Item dialog box 3D plane, adding descriptive text to, 303 adding icon image in, 258–265 3D Tools controls, wrapping Viewport3D telling VS to look for image files in, 269 inside of, 242–243 Add new action button, timeline for, 230–231 3D Tools library, using, 233–243 Add New Item dialog box, creating 3DImage application, creating, 86–88 ImageFactory in, 270–275 3DImageProject Advanced Visualizer animation package, Case Study A, 267–290 OBJ files for, 227 creating in Visual Studio, 208–212 AllowDrop property, setting for DragEnter importing images into, 268–270 event, 170–171 styling and creating the DataSource, alpha, setting to zero, 251–252 275–276 Animate Temple button, creating, 229 3DMediaElementProject Animation Workspace adding a video into, 236 bringing up in Blend 2, 223 building, 234–236 creating Storyboard animations in, 84 making video 3D, 238–243 switching to in Blend 2, 286 wiring up buttons in, 237–238 viewing, 84

337 INDEX app.xaml, in Project panel, 66 making “Hello World” more exciting, 38–51 Appearance bucket myButton control design, 147 changing Visibility menu option in, 282 Objects and Timeline panel in, 41, 65 giving Ellipse bitmap effect with, 77–78 opening after compiling project, 19 of Properties panel, 76–78 opening project in, 30 applicationResourceDict.xaml file, opening and sample XAML code in, 25–26 editing Styles in, 148–149 startup dialog box, 19 AssemblyInfo.cs, in Project panel, 66 styling application background, 32–34 Asset Library button, displaying Asset Library with, styling TextBlock, 34–38 62–63 switching to Animation Workspace, 42 Asset Library Last Used tool, 62 toolbar, 54–64 Asset Library tool, creating ComboBox with, vs. Visual Studio for creating WPF projects, 14 197–198 working with Viewport3Ds in, 220–223 autocomplete function, IntelliSense, 30 Blendables-Tools and Components for Designers automatic garbage collection, in OOP, 95 and Developers, 335 BlueButtonControl B adding Image control to, 154–155 moving to ResourceDictionary, 152–153 background BlueButtonControl Style adding gradient to MyMediaElementProject, 122 applying to multiple Button controls, 155–156 changing gradient, 312 creating, 144–147 styling, 32–34 BlueButtonUserControl Background DependencyProperty, setting for adding functionality to, 163–164 simple Button, 248 seeing in action, 161–163 Background property, setting to No Brush, 220 Boolean variable, 133 Beatriz Costa blog, web site address, 334 creating in Window1.xaml.cs, 262 BeginTime property, in Clock mode, 119 Border layout element, 111–112, 114 binding feature, in XAML, 97 BorderBrush option, in Brushes bucket, 76 Blend 2, 53–88 box Viewport3D 3D image and, 208–212 moving playhead, 287–288 adding DataSource in, 198 selecting Rotation tab in Transform bucket, 287 adding Rows and Columns to setting Visibility value for, 284 LayoutControlsProject, 101 turning down arrows to Box01, 287 changing application size in, 31–32 Brimelow, Lee, web site created by, 233 Column and Row definitions created in, 102 Brush resource, applying to Ellipse, 72 creating 3D objects in, 86–88 Brush Transform tool creating EventAndEventHandlers project in, adjusting gradients with, 33–34, 250 168–170 Blend 2 toolbar, 58–60 creating new WPF Application in, 218–220 changing gradient color direction with, 70 development views and Workspaces, 81–86 changing Rectangle with, 252 downloading and installing, 9–13 creating play Button with, 127 handling of animation by, 231–233 creating Rectangle with gradient with, 58–60 importing images into project from, 191 Brushes bucket keyboard shortcuts for tools, 55 options in, 76 Make a Button feature, 126–129 turning down content for, 32

338 INDEX

Brushes panel, setting up project in, 68–76 Camera Orbit tool, 220 Build Action property, changing video’s, 124 making Viewport3D bigger with, 225 Button controls, 62 on Blend 2 toolbar, 57 applying BlueButtonControl Style to multiple, Canvas layout element, 105–106, 114 155–156 Case Study A, 3DImageProject, 267–290 applying Style to new, 155 Case Study B, 3DTieFighterProject, 293–307 coding PreviewMouseDown event for, 179 Case Study C, SilverlightPagingSystemProject, creating in C#, 96–97 309–322 creating XAML, 96 Case Study D, SilverlightVideoPlayerProject, Make a Button feature for, 126–129 325–331 naming, 145, 177 circle icon, next to eyeball icon, 66 styling Rectangles and turning into, 250–255 classes, in OOP, 93–94 Button ControlTemplate Click event, review of, 170–186 creating, 142–147 ClipToBounds property examining XAML for, 145–147 in Viewport3D Properties panel, 211 giving gradient to, 143–144 unchecking, 220 using on multiple button controls, 155–158 Clock mode, NaturalDuration in, 119 Button Style code-behind page, in Window1.xaml file, 67 adding to ResourceDictionary, 152–153 color handles, adding, 70 editing to display new image, 154 color resources replacing text with image via, 153–155 creating, 70–71 ButtonEnter animations, 41 editing alpha of, 72–73 ButtonLeave animations, 41 Columns, creating visually in Blend 2, 101 Buttons ComboBox, 189 adding play to MediaElement, 126–129 changing size of, 203–204 adding stop to myVideo MediaElement, 119 drawing in workspace, 197–198 adding text to, 39–41 naming, 202 changing Content property, 157–158 wiring to display images, 198–201 changing text color, 157 ComboBox control creating pause Button, 132–134 drawing in the Workspace, 277 creating stop Button, 130–131 populated with image data, 279 creating to run Storyboard animations, 38–41 Common Properties bucket, setting Text property wiring up the home Button, 158–160 in, 253 Common Properties section, of Properties panel, 79 C community sites, web site addresses, 335 constructor, creating for Images class, 272 C# (C Sharp) content Canvas container, creating, 316–319 control vs. XAML control, 97 content pages, creating, 316–319 .NET Framework and, 91–95 Content property, changing Button text with, 40 portability of applications created in, 95 ContentCanvas reasons to use, 92–95 creating, 316–319 XAML and, 91–97 creating functionality in VS, 319–322 Camera, selecting inside Viewport3D, 222 creating sections as XAML files, 316–317 instantiating sections for, 319

339 INDEX

ContentPresenter, 128 DependencyProperties, 247–265 tutorial web site address, 334 animating, 248 controls, overriding default Styles for, 149–152 creating a region for each, 256 ControlTemplate, 142–147 demystified, 247–249 ControlTemplate.Triggers, changing, 150–152 Microsoft official definition of, 247 ControlTemplateProject placing all in C# regions, 255 creating, 142–147 registering custom, 255–258 opening in Blend 2 and VS 2008, 143 setting in XAML, 248 web site address for, 164 DependencyProperties project Copy to Output Directory property, changing a adding icon image to, 258–260 video’s, 124 creating, 249 count variable, creating for ImageFactory class, 192 custom with custom UserControl, 249–264 Create Brush Resource dialog box, 71 design pattern, 190 Create Storyboard dialog box, 223 Design view creating new Storyboard in, 224–226 Blend 2, 82 Create Storyboard Resource dialog box, 85 closing, 28 creating SpinBox in, 287 Design Workspace, 83 Create Torus button, on ZAM 3D toolbar, 215 development resources, IdentityMine, 335 Cursor field, in Properties panel, 79 DiffuseMaterial.Brush node, binding to Cursor property SelectedItem of ComboBox, 283 in Properties panel, 79 Direct Selection tool, on Blend 2 toolbar, 55 putting in XAML for RedButtonUC, 262 DockPanel tool, 108–109, 114 custom UserControls, making functional, 261–264. downloading and installing See also UserControls Blend 2, 9–13 MS Silverlight Tools Alpha Refresh for VS 2008 D Beta 2, 8–9 Visual Studio 2008 Express, 3–8 Data Factory. See also ImageFactory class DragEnter event, 170–171 ObservableCollections and, 189–205 draggedImgStr variable, setting MediaElement DataSource source to path of, 175–176 changing color of gradient, 276 DragLeave event, 172 changing Grid background to a gradient, 275 DragOver event, 172–173 creating that uses ImageFactory class, 198 Drop event, 173–176 creating using ImageFactory class, 275–276 listening for in Independent mode, 118 making use of, 277–280 _DTieFighterProject, coding TextGrid text in, 303–307 styling 3DImageProject and creating, 275–276 dtImages Data Template DataTemplate, 189 creating, 199–200 creating, 198 Daytime lighting scheme, adding to 3DTieFighterProject, 294–295 E debugging information, recorded when error is Easing panel, adding easing to 3D box, 289 thrown, 92 Electric Rain’s ZAM 3D Define in area, in Create Brush Resource dialog creating torus object, 215–217 box, 71 web site address, 86, 212 working with, 212–220

340 INDEX

Ellipse, with drop shadow bitmap effect, 77 G Ellipse tool, 61 garbage collection, automatic in OOP, 95 Ellipses geometryModel3D, displaying, 287 adding radial gradient fill to, 298 gimbal control, 210 moving _3DPlane above, 306 Ginkakuji temple OBJ file, web site address, 227 pasting into Workspace, 298 Gradient brush repositioning next to respective model parts, styling Background with, 32–33 300–301 using, 69–70 email address, for sending samples to author, 226 gradient colors encapsulation, in OOP, 92–93 adding to Window1, 197 error handling, 92 changing, 70 adding to myVideo stop Button, 119 making invisible, 251 adding to stop Button, 131 Grid, grouping all Rectangles into, 253 EventAndEventHandlers project and tags, 30 adding Button control to, 176–177 Grid layout element, 100–104, 114 creating in Blend 2, 168–170 adding controls into, 103–104 creating in VS 2008, 167–186 content positioning using margins, 104 EventHandler, creating for home Button, 159–160 Grid Layout mode, main Grid in, 102 events and EventHandlers, 167–186 Grid tool, displaying layout controls with, 62 EventTriggers, creating for spinBtn, 41–51 Grid.Column, changing values for, 104 exception (error) handling, 92. See also error Grid.Row, changing values for, 104 handling ExpressionBlend.com, web site address, 335 eyeball icons, for objects in Visual Tree, 65–66 H Eyedropper tool Height and Width properties Blend 2 toolbar icon, 58 changing application size with, 31–32 changing color value with, 69 changing for TestPage., 311–312 for Grid Columns and Rows, 102 F Hello World application adding code to, 30 Far Clipping Plane, changing properties for, creating, 27–28 222–223 home Button flyby animation, creating, 223–226 creating EventHandler for, 159–160 FlyBy Storyboard naming, 158 changing name of, 231 wiring up, 158–160 creating, 224–226 naming, 224 running the application, 226 I Foreground option, in Brushes bucket, 76 icon.png, coding path into RedButtonUC, 260 Foreground property, setting for TextBlock, 35–36 icon2.png, importing into MyRedButtonUC2 Frame control, 64 project, 264 IdentityMine, web site address, 335 if/then conditional, using for pause Button, 134

341 INDEX

Image control inheritance, in OOP, 94 adding, 199 InitializeComponent method, 129 adding to Grid and naming, 254 InkCanvas control, using, 63–64 adding to home Button Workspace, 158–160 INotifyPropertyChanged, 195 changing to Image3D control, 282 resolving, 272 drawing in the Grid, 255 input controls, 62 naming in, 255 instance name, giving to Button, 39–41 ScrollViewer in Blend 2 Design view, 110 integrated development environment (IDE). See selecting from Asset Library, 254 Blend 2 ImageBrush, binding to ComboBox, 202–203 IntelliSense, autocomplete function, 30 ImageBrush node, creating in Interaction panel, Objects and Timeline panel, StackPanel.Background node, 202–203 65–81 ImageData class Interactive3D namespace, using 3D Tools library adding NotifyPropertyChanged method to, 274 with, 240–241 adding PropertyChangedEventHandler to, 274 InteractiveVisual3D control, 241–242 adding under Images class, 195 IRhetoric blog, web site address, 334 creating constructor for, 273 is raised drop-down menu, selecting, 44 creating ImageName variable, 273 IsHitTestVisible option, 79 creating under Images class, 272 _isPlaying variable, creating, 329 creating _sImageName private string for, 272 IsSelected Setter, 151–152 passing _sImageName to constructor, 273 IsSelected Trigger, changing, 150–152 ImageDT DataTemplate, creating, 278 ItemsSource property, adding to project, 278 ImageFactory class, 190 creating, 191, 270–275 JK creating DataSource with, 275–276 creating variables for, 192–193 keyboard shortcuts, for tools, 55 ImageName string, creating getters and setters that will set, 274 L images Language Integrated Query (LINQ), new to .NET adding to Images directory, 270 3.0, 95 creating viewing choices for, 280–284 LaserCannon importing into 3DImageProject, 268–270 creating Storyboard for, 301–302 importing into projects, 153–154 moving Ellipse in Workspace, 301 naming, 270 Layout bucket, of Properties panel, 78 using selected, 201–204 layout controls, 61–62 Images class layout elements, 99–114 adding under ImageFactory class, 192–194 LayoutControlsProject, 100–101 creating constructor for, 272 LayoutRoot control, 61 creating in ImageFactory class, 271 LayoutRoot Grid Images constructor, creating, 193–194 changing XAML code in, 218–219 Images directory, adding images to, 270 placing 3D object in, 219 Images folder LeftWing Ellipse creating, 191 changing event for, 301 directory structure, 269 moving to corner of Workspace, 300 Independent mode, 118 Visual Tree, 65 342 INDEX

Lighting Schemes, adding to 3DTieFighterProject, setting to play, 120 294–295 video player, 137 Line tool, 61 MediaTimeline, in Clock mode, 119 ListBox memory management, in .NET CLR, 92 creating and adding new Style to, 149 Microsoft Download Center page overriding default behavior, 149–152 downloading Blend 2 trial from, 9–13 overriding default behavior in XAML, 150–152 finding VS 2008 from, 3 ListBoxItems, setting new Style for, 152 SDK for and LoadedBehavior .NET Framework 3.0 Runtime Components, effect of setting to Manual, 119 web site address, 170 for playback modes, 118 Miscellaneous section, in Properties panel, 80 setting to Manual, 237 modularity, in OOP, 94 lock icons, locking row height or column width mouse events, 176–178 with, 103 MouseDoubleClick event, 178 Lynda tutorial, web site address, 334 MouseDown event , 178–179 MouseEnter and MouseLeave events, 180–181 M MouseEnter state, 181 MouseLeave state, 181 maintainability, in OOP, 94 MouseLeftButtonDown event, 181–182 mainWindow, putting Drop event in, 174–175 adding to applications, 182 mainWindow control, coding for MouseDown listening for for each RedButtonUC, 262–263 event, 179 MouseLeftButtonUp event, adding to applications, mainWindow_Drop method 182–183 adding functionality to, 175–176 MouseRightButtonDown and MouseRightButtonUp creating MessageBox for, 175 events, 183–184 Make a Button feature MouseRightButtonDown event, adding to Blend 2's, 126–129 applications, 184 creating myButton control with, 144–147 MouseRightButtonUp event, adding to applications, Make Control dialog box, naming UserControl in, 183 255 MouseWheel event, 185–186 MediaElement (ME MediaElement), 117–138 MS Silverlight Tools Alpha Refresh for VS 2008 Beta adding code for playing, 129 2, downloading, 8–9 adding to MyMediaElementProject, 122–123 MSDN Silverlight Community, The, web site adding to SilverlightVideoPlayerProject, 326–327 address, 335 controls, 24 MSDN Visual Studio Setup and Installation, web site creating, 174 address, 335 creating resource for source of, 71 MSDN Windows Presentation Foundation, web site creating with stop and play controls, 234–236 address, 333 creating your first project, 120–125 MSDN Windows Presentation Foundation (Avalon) drawing and naming Button controls, 235 FAQ, web site address, 334 drawing in workspace, 234 MSDN WPF Forums, The, web site address, 335 playback modes, 117–120 MyButton setting source of to path of draggedImgStr, responding to DragLeave event, 172 175–176 responding to DragOver event, 173 setting to Manual, 237

343 INDEX myButton control New Project dialog box, 16 adding code in XAML view, 178 creating Hello World application in, 27–28 adding MouseDoubleClick event to, 178 New Storyboard button, adding new Storyboard Blend 2 design breakdown, 147 with, 286 creating, 144–147 No Brush naming, 145 in Brushes bucket, 76 myCB ComboBox, naming, 202 setting for Background property, 220 MyIconDP DependencyProperty, 258 NotifyPropertyChanged method, adding to MyImage's Source DependencyProperty, setting to ImageData class, 274 value of MyIconDP, 260 MyListBoxStyle, editing, 148–149 O MyMediaElement, creating in VS 2008, 123 MyMediaElementProject OBJ files, importing and working with, 227–233 adding video to, 123–124 OBJ model, adding Animate Temple button to, 229 creating in VS 2008, 120–125 object-oriented programming (OOP) language MyMediaElementProject.sln C# as, 91 adding MediaElement to, 122–123 resource reusability in WPF, 141–142 changing Height and Width in Blend, 121 objects, characteristics of in OOP, 92–95 giving gradient background to, 122 Objects and Timeline panel opening, 120 changes in Blend 2, 41 MyRedButton, checking visibility of, 263–264 eyeball icons in Visual Tree, 65–66 MyTextDP property Interaction panel, 65–81 adding into XAML, 256 locking items in, 130 changing in RedButtonUC, 260 Record Keyframe button in, 47 registering, 256 selecting elements in, 31 setting Text property of TextBlock to value of, styling Background in, 32–34 257 OBJImport application, creating, 227–228 ObservableCollection project adding images into, 194–195 N creating, 190 Name (Key) field, in Create Brush Resource dialog importing images into, 191 box, 71 opening in Blend 2, 197–201 Name property, changing for Button, 40–41 source application web site address, 204 NaturalDuration, in Clock mode, 119 ObservableCollections, 271 navigation buttons closing off namespace, 195–197 creating, 313–316 creating with Abstract factory pattern, 191–197 creating events for, 319–322 Data Factory and, 189–205 Near Clipping Plane, changing properties for, opening in Blend 2, 197–201 222–223 OpacityMask property, editing alpha of project .NET common language runtime (CLR), of .NET with, 73 Framework, 92 .NET Framework P C# and, 91–95 .NET CLR of, 92 padlock icon, in Objects and Timeline panel, 66 Page.xaml, changing properties for, 311

344 INDEX

Paint Bucket tool, on Blend 2 toolbar, 58 Record Keyframe button, in Objects and Timeline Pan tool, on Blend 2 toolbar, 57 panel, 47 Paragraph tab, in Common Properties bucket, 253 Rectangle partial classes, new feature in .NET 2.0, 95 adding Grid to, 281 Path, setting play symbol's, 128 building solid with rounded edges, 313 Path tool, creating play button triangle with, 328 changing Visibility value in, 282 pause Button, creating, 132–134 creating a reflection for, 73–76 Pen tool, for creating play Button, 127 decreasing width of, 280 Pen/Pencil tools, on Blend 2 toolbar, 56 filling with gradient, 314 play and stop buttons, wiring up in VS 2008, modifying Fill property, 279–280 237–238 naming and setting Visibility property, 284 play Button, adding to MediaElement, 126–129 Rectangle control, drawing in Workspace, 143, 277 playback modes Rectangle tool, 60 MediaElement, 117–120 creating pause Button with, 132 switching between, 119–120 creating play Button in Workspace with, 127 Preview events, 179–180 creating stop button icon with, 329 PreviewMouseDown and PreviewMouseUp events, creating stop Button with, 130 179–180 Rectangles private variable, creating for pause Button, 133–134 grouping into a Grid, 253 Project panel, 66 pasting into Workspace, 252 adding existing item through, 208–210 rotating in Workspace, 252 assets that make up project, 66–67 styling and making into Button control, 250–255 projects, importing images into, 153–154 RedButtonUC Properties panel, 67–80 changing Height and Width of, 261 changing Content property in, 40 changing properties in XAML, 261–262 changing Width and Height values in, 32 copying XAML for into Window1.XAML, 261 in VS 2008, 125 renaming in Properties panel, 255 setting up project in, 68–76 verifying it is registered and set, 257 PropertiesPanel project RedButtonUC.xaml.cs changing solid fill to gradient in, 69–70 adding this.Loaded method in constructor, 257 creating, 68–69 opening in Solution Explorer, 255 PropertyChangedEventHandler, adding to References directory, in Project panel, 66 ImageData class, 274 ResourceDictionaries adding Button Style to, 152–153 QR creating, 71–72 creating for ControlTemplate project, 147–148 RadioButton controls Resources folder, creating, 269 decreasing Rectangle width for, 280 Resources panel, applying resources in, 81 making visible, 285 Resources/Images folder, changing Image control placing in Rectangle, 281 in, 282 wiring up for Image3D, 284–286 Rotate tab, in Transform bucket, 232 radius handles, giving Rectangle rounded edges Rows, creating visually in Blend 2, 102 with, 143 Rows and Columns, exercise to understand, 103 Recent Projects section, in VS 2008, 121 runtime error, 119

345 INDEX

S coding play, pause, and stop buttons, 330 ScrollViewer control, setting for scrollbars, 110 creating, 325–331 ScrollViewer layout element, 110–111, 114 _simageName private string, creating, 272 scrubber, 118 Sneath, Tim, blog web site address, 334 Search section, in Properties panel, 80 Solution Explorer, 29–30 SelectedItem SpeedRatio, value in Independent mode, 118 binding ImageSource property to, 203 spin Storyboard, creating, 41–51 setting background of StackPanel to, 189 spinBtn, creating EventTriggers for, 41–51 Selection tool Split view, in Blend 2, 83 Blend 2 toolbar, 55 StackPanel changing Rectangle size with, 252 creating, 84–86, 199 giving Rectangle rounded edges with, 250–251 layout element, 107, 114 rotating Rectangle with, 252 naming, 84 styling TextBlock with, 34–35 wiring up functionality in XAML, 201 Setter code, for HighlightTextBrushKey, 151 tag, closing off StackPanel control shape tools, on Blend 2 toolbar, 60–61 with, 202 Show Material button, clicking and selecting Glossy StackPanel.Background node, creating, 202 tab, 214–215 stop Button, creating, 130–131 Show snap grid button, 128 Storyboard ShowLeftWing Storyboard, creating, 299–300 closing, 50, 289 Silverlight. See WPF/Silverlight renaming, 46–47 Silverlight 1.1 vs. WPF for applications, 309–310 Storyboard animations Silverlight 1.1 Alpha Refresh developer plug-in, web creating button to run, 38–41 site address, 309 creating for 3DTieFighterProject, 299–302 Silverlight 1.1 MediaElement project, creating, creating spin, 41–51 325–331 creating visual, 23 Silverlight button controls Storyboard resource, creating new, 85 adding text to, 315 String ImageName, creating public, 273 building, 313–315 Stroke property, setting to No Brush, 252 copying to have 4 buttons, 315 Styles, 147–149 grouping into a Canvas, 316 overriding default for controls, 149–152 wrapping into a layout control, 315 setting control properties with, 147–149 Silverlight Forums, The, web site address, 335 using in WPF/Silverlight, 24–25 Silverlight homepage, web site address, 334 System Brush Resources list, HighlightTextBrushKey Silverlight project, creating, 310–322, 325–331 in, 151 Silverlight resources and WPF, 333, 335 System.Collections.ObjectModel class, importing SilverlightPagingSystemProject into Images class, 271 Case Study C, 309–322 System.Windows.Media.Imaging namespace, adding creating in VS 2008, 310–322 to DependencyProperties project, 260 web site address for source application, 322 SilverlightVideoPlayerProject T adding buttons to, 327–329 TabControl, 64 adding gradient to buttons, 327 images used to populate in Project panel, 66 adding MediaElement to, 326–327 in Visual Tree, 65 Case Study D, 325–331

346 INDEX

TabItems, in Visual Tree, 65 traffic analysis tools, using Preview events for, TempleAnimation, renaming FlyBy Storyboard to, 179–180 231 Transform bucket, Rotate tab in, 232 TestPage.html Transform section, in Properties panel, 79–80 adding body style to, 312 Triggers changing Height and Width of, 311–312 adding action to when it is raised, 230 text, changing color of for Buttons, 157 changing for Animate Temple button, 230 Text bucket, in Properties panel, 79 creating for spinBtn, 41–51 Text primitive tool, activating in ZAM 3D toolbar, Triggers and Storyboards, creating, 43–50 213 Triggers panel UIElement collapsing and expanding, 42–43 changing color to gradient, 37 creating new event in, 43 choosing a color for, 36 tutorials, web site addresses, 334 increasing text font size, 37–38 setting properties for, 35–36 U styling, 34–38 TextBlocks UIElements (user interface elements), 24 adding control into a Grid, 253 Uniform Resource Identifier (URI), setting adding to display path of Image, 199 MediaElement's, 118 adding to Hello World application, 30 UniformGrid layout element, 114 in different Grid Rows and Columns, 104 Ellipses spread out evenly in, 112 giving unique name to, 254 URI. See Uniform Resource Identifier (URI) hard-coding to be in Row 0 and Column 0, 103 UserControls setting Angle property of, 48–50 creating custom, 160–164 setting Foreground property of, 253 making custom functional, 261–264 setting Text property of, 257 putting custom on 3D plane mesh, 234 specifying alignment for, 253 with custom DependencyProperties project, TextBox tool, 62 249–264 This document, making resource available to current document, 71 V Tie Fighter model, importing from ZAM 3D, video 294–295 adding to MyMediaElementProject, 123–124 TieText changing Build Action setting, 124 changing from TextBlock when application starts, changing Copy to Output Directory property, 124 306 creating button functionality for player, 329–331 setting Text property of, 305 creating player, 325–331 TimeSpan, setting for stop Button, 131 making 3D, 238–243 toggle button, creating, 158–159 video toggle Button toggleVideo Button, creating event handler for, 136 creating, 134 torus object, adding material to, 216 styling, 135–136 TowerAnimation Storyboard wiring up, 136 changes recorded into, 231 ViewBox tool, 112–114 closing, 233 viewing choices, creating for images, 280–284 specifying start position for, 231–233

347 INDEX

Viewport3D W changing Near and Far Clipping Plane properties, Wavefront Technologies, OBJ files developed by, 222–223 227 changing playhead Y property and rotation, 233 web site addresses creating 3D box, 283–284 3D Tools library, 233 creating 3D objects in the XAML, 207 3DImage application, 88 gimbal control, 210 3DImageProject source application, 290 making and adding camera to, 240 Beatriz Costa blog, 334 making very small, 223 Blendables-Tools and Components for Designers moving playhead out 2 seconds, 232 and Developers, 335 naming Image3D, 284 book updates, 333 playing with in Blend 2, 220–244 ContentPresenter tutorial, 334 recording default axis of, 232 ControlTemplateProject application, 164 rotating with Camera Orbit tool, 221 DependencyProperties project application, 265 unchecking ClipToBounds, 282 downloading OBJImport files, 233 using gimbal tool to skew, 282 downloading Silverlight, 9 working with in Blend 2, 220–223 Electric Rain’s ZAM 3D, 86, 212 wrapping 3D Tools controls inside of, 242–243 EventAndEventHandlers project, 186 zooming in and out, 221–222 ExpressionBlend.com, 335 Viewport3D control, turning Image control into, Ginkakuji temple OBJ file, 227 210 Hello Word files, 51 Visibility drop-down menu option, changing, 282 IdentityMine, 335 Visibility property Lynda tutorial, 334 changing for Viewport3D, 225 MediaElement application without video assets, setting as hidden for one RedButtonUC, 262 137 Visual Brush onto 3D Primitive radio button, for Microsoft downloads, 3 spinning 3D box, 289 MSDN WPF Forums, 335 Visual Studio 2008 MSDN Silverlight Community, The, 335 coding TextGrid text in, 303–307 MSDN Visual Studio Setup and Installation, 335 creating EventAndEventHandlers project in, MSDN Windows Presentation Foundation 167–186 (Avalon) FAQ, 334 creating new WPF application in, 295–307 MSDN Windows Presentation Foundation, 333 New Project dialog box in, 27 ObservableCollection project source, 204 sample XAML code in, 25 Silverlight 1.1 Alpha Refresh developer plug-in, Visual Studio 2008 Beta 2 Professional Edition 309 burning installation DVD for, 3 Silverlight Forums, 335 downloading and installing, 8–9 Silverlight homepage, 333–334 running installation DVD, 4–8 SilverlightPagingSystemProject source starting and opening new project in, 14–15 application, 322 vs. Blend 2 for creating WPF projects, 14 SilverlightVideoPlayerProject source application, Visual Studio 2008 Express, downloading and 331 installing, 3–8 SilverlightVideoPlayerProject, 331 Visual Studio Designer, turning off, 17 Sneath, Tim blog, 334 Visual Tree, in Workspace, 65–66 tutorials, 334

348 INDEX

WPF FAQ Index, 334 WPF project, creating your first, 14–20 ZAMDWPF example application, 226 WPF solution, created by Visual Studio, 17 web site paging system. See WPF/Blend workflow, and your first WPF SilverlightPagingSystemProject application, 23–51 WelcomeScreen.xaml, creating new section as, 322 WPF/Silverlight When drop-down menu, selecting, 44 a new way of working, 23–25 Width and Height properties, changing, 31–32 requirements for, 2 [Window] WPFTestApplication.Window1, compiling and giving changing Height and Width of, 143 basic content, 18 selecting in Objects and Timeline panel, 143 WrapPanel layout element, 107–108, 114 [Window] UIElement, 31 .Loaded event, creating, 44 X node, adding code to, 239–240 X button, closing Storyboard with, 50 Window1.xaml file XAML (Extensible Application Markup Language), adding MyTextDP property into, 256 96–97 creating MediaElement inside the Grid, 123 browser applications (XBAPs), 309 in Project panel, 67 cleaning for 3DTieFighterProject, 296–297 renaming to mainWindow, 174 for myButton control, 145–146 Window1.xaml.cs overriding default ListBox behavior in, 150–152 adding DragEnter EventHandler into, 171 reformatting for readability, 147 listening for Click for RadioButtons, 284 XAML control listening for Drop event in, 174–175 creating vs. C# control, 97 setting MediaElement to play in, 125 example of typical, 96 Windows Presentation Foundation (WPF). See WPF XAML page, opening in XML view, 18 (Windows Presentation Foundation) XAML view, in Blend 2, 82–83 workflow, between developers, designers, and XML documentation, embedding into source files, engineers, 24–25 95 Workspaces, 83 XML Editor, setting as default, 17 and Blend development views, 81–86 drawing Button control in, 39 YZ WPF (Windows Presentation Foundation) Z angle, setting, 287–288 3D and, 207–244 ZAM 3D. See also Electric Rain’s ZAM 3D building Hello World application, 27–28 importing a model from, 294–295 DependencyProperties as part of, 249 web site address, 86 setting up development environment, 1–21 ZAM 3D text primitive Silverlight resources and, 333, 335 changing name of, 213 vs. Silverlight 1.1 for applications, 309–310 giving style to, 214–215 WPF Application project, creating in Visual Studio ZAM3DWPF project 2008, 100 creating in Blend 2, 218–220 WPF button, creating, 38–41 resolving housekeeping issues, 220 WPF Button control, building Silverlight control XAML portion in Split view, 218 that acts like, 313–315 Zoom tool, on Blend 2 toolbar, 57 WPF FAQ Index, web site address, 334 WPF layout elements. See layout elements

349