Numbers COPYRIGHTED MATERIAL · overview of, 368 PropertyPath and, 370 data framework ASP.NET, 362...
Transcript of Numbers COPYRIGHTED MATERIAL · overview of, 368 PropertyPath and, 370 data framework ASP.NET, 362...
Index
Numbers3D tools, 56
Aabsolute positioning, Css, 131Access Control Lists (ACLs), AsP.NeT security, 462Accessibility Checker, expression Web, 122ACLs (Access Control Lists), AsP.NeT security, 462ACT (Application Center Test), 581ActiveX, 16ad hoc queries, for data retrieval, 408Add service reference, 398Add Service References tool, Visual studio 2008,
308–309ADO.NeT
Data Services, 387, 399–401Entity Data Model, 400overview of, 16Silverlight not supporting, 409
Advanced stream redirector (AsX), 482agcore.dll, 23AJAX (Asynchronous Javascript and XmL)
asynchronous web development, 618Control Toolkit, 206cross-domain calls, 289Fiddler and, 573modal screens, 274Silverlight integration with, 249–250
AJAX-style updates, 5animation. see also graphics
applying to UI elements with Expression Blend, 126color animation using key frame example, 554–555ColorAnimation, 550–551DoubleAnimation, 548–549Expression Blend and, 56From/To/By approach, 547–548key frame approach, 553KeyFrames collection, 553–554multiple From/To/By animations, 551–553performance and, 597per-frame animation call back, 555–556PointAnimation, 550StoryBoad object and, 548
summary, 556Timeline and, 547types of, 547
Animation Workspace, expression blendapplying animations to UI elements, 126overview of, 59
Application Center Test (ACT), 581Application class, System.Windows namespace,
66–69application level, setting styles at, 223–224Application object, 223–224application services, AsP.NeT integration with
silverlight, 25applications
life cycle, 27–29localization, 161–164per instance customization, 436programming. see programming Silverlight
applicationsreducing chatty applications, 616–617
Appmanifest.xaml, 65–66App.xaml page, 223–224architectural awareness, in AsP.NeT, 7architecture, silverlight, 9–29
application life cycle, 27–29client platform, 11–12client/server model, 9–10data classes and, 22data-binding, 367–368DLR (Dynamic Language Runtime) and, 22–23illustration of, 12installed files, 23–24.NET Framework elements, 16–17.NET Framework features included/excluded in,
17–18networking and, 21–22overview of, 9platforms, 10–11presentation core, 13–16server platform, 11summary, 29updates, 28–29WPF (Windows Presentation Foundation) and, 18–21
artwork, expression Design for, 129AsCX files, 424
77751bindex.indd 621 12/18/08 9:48:48 AM
COPYRIG
HTED M
ATERIAL
622
ASMX file
AsmX file, 301AsmX services. see AsP.NeT Web servicesasp:Media, AsP.NeT server controls for silverlight, 27AsP.NeT
AJAX Control Toolkit, 206AJAX support for, 249application services, 25caching, 401composite controls, 25data framework, 362dynamically generating XAML and, 26Expression Web for accessing ASP.NET controls, 122GET and POST methods, 278graphics for adding life to, 515–516integration with. see integration with ASP.NETlayout options, 130–131Media Server control, 500–502modal screens, 274.NET Framework and, 16playback control, 500–501Profile Provider, 235–239server controls for Silverlight, 27Silverlight communicating with, 26themes, 214traditional data handling, 407–408user controls, 424–426validation control, 417
AsP.NeT Futures, 501AsP.NeT Web services, 21
ASMX file, 301calling with Silverlight, 308–310overview of, 301WebMethods, 302–303
asp.Silverlight, AsP.NeT server controls for silverlight, 27
<asp:Silverlight> control, 69–70assemblies
deploying user controls and, 427obfuscation techniques and, 478
Asset Library button, 126–127Astoria, 387, 399–401AsX (Advanced stream redirector), 482Asynchronous Javascript and XmL. see AJAX
(Asynchronous Javascript and XmL)asynchronous pattern, for web development, 617–618asynchrony, threading and, 95ATOm (Atom syndication Format), 333–335
how it works, 334–335syndication feed classes, 335–337
Atom syndication Format. see ATOm (Atom syndication Format)
attached properties, XAmL, 40–41attacks/attackers, 462attributes, application instantiation and, 70–71
audio formats, 201, 482audio/video
ASP.NET Media Server control, 500–502AutoPlay property, 484embedding in ASP.NET applications, 482Expression Encoder and, 504–506formats, 201, 482Height and Width properties, 487inherited properties, 498–500MediaElement control, 482MediaElement events, 511–512NaturalDuration property, 486overview of, 481playback controlled from ASP.NET, 500–501playback controls, 491–495Position property, 484–486SetSource method, 512–513Source property, 483–484streaming, 514Stretch property, 496–498summary, 514timeline markers, 503timeline markers via code, 506–510Volume property, 488–490Windows Media File editor, 503–504
authenticationASP.NET, 462, 474–478membership provider, 471–472
authorization, AsP.NeT, 462AutoCompleteBox control, 206–207AutoCompleteExtender control, AsP.NeT, 206AutoGenerateColumns, 405AutoPlay property, MediaElement, 484
bBackground property, drawing in XAmL, 42backgrounds, transparent, 601–602BackgroundWorker class, threading model, 95–100bAmL, 13base Class Library (bCL), .NeT Framework, 16, 617base classess, silverlight Object model, 84–85bCL (base Class Library), .NeT Framework, 16beginning Javascript (mcPeak and Wilton), 83binding component, data-binding architecture, 368BitmapImage, 540–542bitmaps. see raster graphicsblend. see expression blendBorder type, 438bottlenecks, performance, 590–591bridging, code-behind binding and, 375browsers
interacting with browser from Silverlight, 105–110interacting with Silverlight from browser, 110–114
77751bindex.indd 622 12/18/08 9:48:48 AM
623
colors
mouse handling properties and, 256Brush classImageBrush, 531–533LinearGradientBrush, 528–530overview of, 526RadialGradientBrush, 530–531SolidColorBrush, 526–528VideoBrush, 533–534
brushes, drawing in XAmL, 44bubbling routing strategy
routed events and, 92–94Silverlight support for, 245
BufferingProgressChanged event, MediaElement, 511
built-in styles, custom controls, 451–452Button control
adding Click event to, 170Silverlight user input controls, 176–177states, 227System.Windows.Controls, 21
Button event handlercode-behine file and, 86–87toggling between Embedded mode and Full-screen
mode, 155–156buttons
adding to Expression Blend design surface, 128visual styles connected to button state, 445–447
Ccaching, 401calculator class, 111Calendar control
customizing, 448as Silverlight user input control, 183–185System.Windows.Controls, 186
calls, Web serviceASP.NET Web Service proxy, 308–310creating WCF proxy, 305making asynchronous calls with WCF proxy, 305–308
Canvas control, 136–143adding/positioning elements in, 136–138hosting page settings effectively overriding Canvas
properties, 143InkPresenter deriving from, 259–260layout options in Silverlight, 132layout performance issues, 612nesting Canvas within Canvas, 138–139overlapping elements within, 140–142positioning elements with X and Y coordinates, 136
CaptureMouse( ) method, 254CAs (code access security), 463–464Cascading style sheets (Css)
Expression Web support for, 122layout options in ASP.NET, 130–131
case-sensitivity, XAmL, 36central location, styles at, 218–219Chart control, 210–212chatty applications, 616–617CheckBox control, 178–179child objects
adding/positioning on Canvas, 139control trees for managing, 171XAML (eXtensible Application Markup Language), 269
class definitions, security levels and, 465–466classes, silverlight data, 22Click event, adding to Button control, 170ClickMode properties, RepeatButton control, 181client access policy, for socket server, 343–347client platform, silverlight architecture, 11–12clientaccesspolicy.xml, 291clients
access policy to socket server, 343–347sockets on, 340–343
client/server architecture, 9–10CLr (Common Language runtime)
ASP.NET Web Services and, 301calling Web Services and, 304converting XML schema to, 320data-binding performance considerations, 386–387element of .NET Framework, 17mapping data to CLR objects, 288OOP (object oriented programming), 384
codecode level security, 462event handling programmatically, 171–172instrumentation of, 587timeline markers created via, 506–510
code access security (CAs), 463–464code behind
accessing Content data, 389auto-generated method, 75–76binding, 373–375Button event handler and, 86–87event handlers, 245fade screen effect, 274interacting with traditional properties, 246XAML and, 46–49x:class attribute for referencing, 72
code generators, 57ColorAnimationUsingKeyFrames, 553–555colorsColorAnimation, 550–551gray scale colors, 199inline styles, 217key frame example, 554–555linear gradients, 528–530options for specifying brush color, 527–528radial gradients, 530–531
77751bindex.indd 623 12/18/08 9:48:48 AM
624
columns
columnsDataGrid control and, 192Grid control and, 144properties, 145–146sizing Row and Column elements, 146–149
COm components, 16ComboBox control, 195–196Common Language runtime. see CLr (Common
Language runtime)communication
ASP.NET integration with Silverlight, 26with server. see server communicationSilverlight features, 5
compile-time problems, 560–562complex bindings, 378–381composite controls, AsP.NeT integration with
silverlight, 25conditional statements, Javascript, 79–80consuming remote data, 396–399container controls, 269content files, local resources, 388ContentControl, System.Windows.Controls, 20–21ContentPresenter control, 442–443contracts, WCF service
data contract, 293–294service contract, 294–295WCF duplex service, 347–348
Control classas base class, 448customizing. see custom controlsSystem.Windows.Controls, 20
control trees, for managing parent/child controls, 171controls, silverlight, 167–212<asp:Silverlight> control, 69AutoCompleteBox control, 206–207Button control, 176–177Calendar control, 183–185Chart control, 210–212CheckBox control, 178–179ComboBox control, 195–196DataGrid control, 191–193DatePicker control, 186–187defining in XAML, 169–170event handling declaratively, 170–171event handling programmatically, 171–172HyperlinkButton control, 177–178Image control, 199–200items controls, 188–189layout. see layout controlsListBox control, 189–191media controls, 198MediaElement control, 200–202MultiScaleImage control, 203–204overview of, 167–168
PasswordBox control, 176Popup control, 196–198ProgressBar control, 202–203RadioButton control, 179–180RepeatButton control, 180–182rich control library in Silverlight, 5ScrollViewer control, 193–195Slider control, 182–183summary, 212TextBlock control, 173–174TextBox control, 174–176toolkit controls, 205–206ToolTip control, 187–188TreeView control, 208–210Type Library and, 16user input controls, 172–173Windowless, 600–601WrapPanel control, 207–208x:Name property, 74
ControlTemplate classcreating new ControlTemplate, 225–226customzing with skins, 440–443overview of, 224
conversions, 382–384coreclr.dll, 23cross-domain calls, 289–290
Flash cross-domain policy files, 290overview of, 289–290self-hosted WCF service and, 299–301Silverlight cross-domain policy files, 291–292
cross-domain security, 470crossdomain.xml, 290cross-platform support, 4cryptography, 479Css (Cascading style sheets)
Expression Web support for, 122layout options in ASP.NET, 130–131
culture parameter, in conversions, 383CurrentStateChanged event, MediaElement, 511custom controls, 423–460. see also user controls
building, 450built-in style, 451–452composite controls compared with custom server
control, 25custom properties, 452–454overview of, 423, 447–448parts model, 454requirements for, 449scenarios for use of, 447–448summary, 460visual states parts, 458–459
customizing current controlsexample mixing styling and skinning, 443–444overview of, 435
77751bindex.indd 624 12/18/08 9:48:49 AM
625
debuggers. see also troubleshooting
scanarios, 436–437skins for, 440–443styles for, 437–440visual customization, 435–436visual styles connected to button state, 445–447
Ddata
accessible by Silverlight, 286data-processing options, 288–289performance issues when working with, 613–616
data classes, silverlight, 22data containers, creating custom, 362data contract, WCF service, 293–294data controls
data templates, 402–403DataGrid control, 403–407namespaces, 364overview of, 401System.Windows.Controls, 403
data entity classes, 294data flow
conversions and, 382in data binding example, 371OneWay, TwoWay, and One Time, 369overview of, 368PropertyPath and, 370
data frameworkASP.NET, 362creating custom data containers, 362namespaces, 363–364overview of, 361–362
data manipulationbinding from XML, 415dynamic XAML with LINQ, 414–415LINQ, 408–412LINQ to XML, 412–414overview of, 407traditional handling, 407–408
data repositorieslocal data. see local dataoverview of, 387–388remote data. see remote data
Data services, ADO.NeT, 387, 399–401data sources, binding item controls to, 189data storage/retrieval
ADO.NET Data Services, 399–401caching, 401consuming remote data, 396–399data repositories, 387–388interacting with hosting computer, 394–396isolated storage, 392–394
local data, 388local resources, 388–391overview of, 387remote data, 396site-of-origin resources, 396
data templates, 402–403data-binding
architecture, 367–368binding from XML, 415code-behind binding, 373–375complex bindings, 378–381conversions and, 382–384data flow and, 368–370DataContext property, 375, 378dependency properties and, 384–386graphical view of, 366ListBox control, 189–190mixing binding techniques, 378overview of, 365–367performance and, 386–387in practice, 370–372validation, 419–420XAML binding, 375–377
DataContext
data-binding example, 381defining with XAML code, 378inheritance and, 375
DataContractJsonSerializer class, 328, 330–332DataGrid control, 403–407
adding extra information fields, 406–407adding namespace for, 403automatic column generation, 404–406configuring data binding for, 403–404data control namespaces, 364overview of, 403performance optimization and, 616Silverlight items controls, 191–193
DataGridCheckBoxColumn, 404DataGridTextBoxColumn, 404DataSet control, AsP.NeT, 301, 408DataTemplate, 402–403DatePicker control, 186–187datesCalendar control, 185DatePicker control, 186
DateTime.Now.Ticks method, 594–595dbgshim.dll, 23Debug class, 587debuggers. see also troubleshooting
debugging applications, 566–570tools for working with XAML, 57Visual Studio 2008 as, 563–566
77751bindex.indd 625 12/18/08 9:48:49 AM
626
declarative programming
declarative programmingevent handling, 170–171Silverlight applications and, 244XAML and, 32
Deep Zoom Composer tool, 203–204, 544DeepZoom, image handling, 542–546default styles, 438Delay values, RepeatButton control, 181dependency propertiesAutoGenerateColumns, 405binding, 386custom controls and, 452–454data-binding performance considerations, 386declaring, 384–385interacting with, 247overview of, 384Setter object for setting, 437user controls and, 432–433
Dependency Property Identifier, 385DependencyObject class
Silverlight Object Model, 84, 384System.Windows, 19
deploying silverlight applications, 64–66deploying user controls, 427Design Workspace, in expression blend, 59designers, vs. developers, 590design-time problems, 560–562developers
vs. designers, 590XAML basics and, 31–32
development, AsP.NeT for, 7DHTmL (Dynamic HTmL), 3Digg, 287, 310digital media, expression media for managing, 129–130Digital rights management. see Drm (Digital rights
management)Dispatcher object
interacting with properties, 246System.Windows.Threading, 100–102
DispatcherTimer, 102–105, 599display modes
Embedded display mode, 154Full-screen display mode, 154–161overview of, 154
DIV tagsCSS and, 130–131sizing instructions and, 134–135
dll assembly, Microsoft.Windows.Controls, 205DLLs, creating custom data containers, 365DLr (Dynamic Language runtime)
overview of, 22–23Silverlight features, 5validation using dynamic languages, 418–419
DnsEndPoint, 340–341
document object model. see DOm (document object model)
Document property, HtmlPage class, 106DOm (document object model)
browser interaction and, 105–110event handling, 80integration with Silverlight, 15–16JavaScript and, 77manipulating with JavaScript, 80–83
domainscross-domain communication, 289–290cross-domain security, 470Flash cross-domain policy files, 290Silverlight cross-domain policy files, 291–292supported by Silverlight, 286
dots per inch (DPI)high-resolution monitors and, 256resolution-independent rendering and, 132
DoubleAnimation, 548–549DoubleAnimationUsingKeyFrames, 553DownloadProgressChanged event, MediaElement, 512downloadsDownloadProgressChanged event, 512ProgressBar control, 202–203
DPI (dots per inch)high-resolution monitors and, 256resolution-independent rendering and, 132
drag-and-drop, user interaction via, 263–266drawing basics, XAmLEllipse object, 41–43Line object, 45–46overview of, 41Rectangle object, 43–45
DrawingAttributes property, stroke options, 262Drm (Digital rights management)
overview of, 14–15PlayReady technology, 15Silverlight features, 5
DropDownList control, AsP.NeT, 195duration, media, 486Dynamic HTmL (DHTmL), 3Dynamic Language runtime. see DLr (Dynamic
Language runtime)dynamic languages. see also DLr (Dynamic Language
runtime)overview of, 22validation, 418–419
dynamically loading XAmL, 49–50, 87–89
ee parameter, 245eCmAscript, 77effects, enhancing user navigation, 273–275
77751bindex.indd 626 12/18/08 9:48:49 AM
627
Flickr
elementsadding/positioning on Canvas, 136–138CSS methods for positioning, 131Margin property, 151–152overlapping on Canvas, 140–142positioning with X and Y coordinates, 136reusing, 611sizing Row and Column elements, 146–149stacking (StackPanel), 150–151
elements parts, parts model, 454–458Ellipse
drawing with XAML, 41–43Shape class and, 517
EllipseGeometry, 522embedded mode
display options, 154toggling between Full-screen display mode, 155–157
embedding audio/video, in AsP.NeT applications, 482EnableFrameRateCounter, 592–594EnableRedrawRegions, 593–594encapsulation, user controls and, 428encryption algorithms, 479enterprise Web services, 21entity Data model, ADO.NeT, 400environments, AsP.NeT for, 7eraser mode, Ink feature, 262–263errors, 560. see also troubleshootingethereal tool, 570event handlers
declarative, 170–171JavaScript, 80media playback, 495programmatic, 171–172routed events, 93–94user controls and, 434user interaction, 244–245for wiring up events, 90–92
eventskeyboard events, 257MediaElement, 511–512mouse events, 251–252routed events, 92–94types of interaction events, 244UIElements events, 244wiring up, 90–92
exception handling, 586–587exploitations, security, 461–462expression blend, 123–129
add Text Block to design surface, 126adding button to design surface, 128adding controls, 126adding rectangle to design surface, 124adding/changing properties, 124–125applying animations, 126
creating user controls, 424, 430design environment and, 8drawing objects with vector graphics, 129interoperability with Visual Studio, 56, 59Properties pane, 127–128starting new project, 123tools for working with XAML, 56–57visual state management, 446–447
expression Design, 129expression encoder
converting audio/video formats, 201overview of, 130sizing at design time, 606timeline markers, 504–506
expression mediaExpression Encoder and, 130overview of, 129–130
expression studio, 130expression suite
compared with Visual Studio, 121–122Expression Blend, 123–129Expression Design, 129Expression Encoder, 130Expression Media, 129–130Expression Studio, 130Expression Web, 122
expression Web, 122eXtensible Application markup Language. see XAmL
(eXtensible Application markup Language)extensible markup Language. see XmL (extensible
markup Language)extensible stylesheet Language Transformation (XsLT)
LINQ and, 364real-time standarads validation in Expression Web, 122
extensionsLINQ, 364markup, 38–40
Ffade screen effect, 274Fiddler, 573–574Fielding, roy, 287Fill property, drawing in XAmL, 42Firebug, 575fixed positioning, Css, 131Flash
animation and, 516cross-domain policy files, 290rich content and, 4
FlickrREST and, 287, 310retrieving XML data, 324–325serializing/deserializing data, 321–324
77751bindex.indd 627 12/18/08 9:48:49 AM
628
FocusVisualElement
FocusVisualElement, 226fonts
applying inline styles to, 216–217TextBox control, 175
formats, audio/video, 201, 482form-based validation, 418Forms authentication, 471–472frame rates
low, 591monitoring, 592–594
FrameworkElement classMediaElement deriving from, 482Shape class inheriting from, 517Silverlight Object Model, 84Style property, 219System.Windows, 20
free-hand drawing, 258From/To/by animationColorAnimation, 550–551DoubleAnimation, 548–549multiple From/To/By animations, 551–553overview of, 547–548PointAnimation, 550StoryBoad, 548
Full-screen display mode, 154–161how to activate, 154performance and, 603–605scaling contents to take advantage of, 159–161toggling between Embedded mode and, 155–157viewing current screen dimensions, 157–158
function keyword, 78functions, Javascript, 78
Ggame loops, 598–600generic.xaml
built-in style, 450–451templating and, 227–232
Geometry objectsEllipseGeometry, 522GeometryGroup, 523–524LineGeometry, 523overview of, 521–522Path class and, 521PathGeometry, 524–526RectangleGeometry, 522System.Windows.Media., 521
GeometryGroup, 523–524getElementById method, 81getElementByTagName method, 81GetPosition method, 253–254GetScreen method, 279
glyphs, 597–598graphics. see also animation
brushes, 526DeepZoom, 542–546EllipseGeometry, 522enlivening ASP.NET, 515–516Expression Design for advanced, 129Geometry objects, 521–522GeometryGroup, 523–524Image and BitmapImage, 540–542image handling, 540ImageBrush, 531–533LinearGradientBrush, 528–530LineGeometry, 523overview of, 515Path class, 521PathGeometry, 524–526Polygon class, 517–519Polyline class, 519–521RadialGradientBrush, 530–531RectangleGeometry, 522RotateTransform, 535–536ScaleTransform, 537–538Shape class, 517SkewTransform, 536–537SolidColorBrush, 526–528summary, 556transforms, 535TranslateTransform, 539–540VideoBrush, 533–534
gray scale colors, 199Grid layout object, 143–149
defining columns and rows, 144layout options in Silverlight, 132layout performance issues, 612placing TextBlock objects, 145setting row and column properties, 145–146sizing Row and Column elements, 146–149TABLE HTML element compared with, 143
gridsDataGrid control (Silverlight), 191–193GridView control (ASP.NET), 191–192
GridView control, AsP.NeT, 191–192
HHandled parameter, 245handwriting, Ink feature, 258Height property
drawing in XAML, 41MediaElement control, 487performance and, 605–606
hinting, 597
77751bindex.indd 628 12/18/08 9:48:49 AM
629
integration with ASP.NET
hosting computerhosting page settings overriding Canvas
properties, 143local data and, 394–396UI (user interface) and, 134–136
HTmL (HyperText markup Language)ASP.NET layouts derived from, 130challenge of creating rich user interface, 3Silverlight providing HTML/Managed Code bridge, 5standards, 10–11types of data Silverlight can access and process, 286
HTmL tables, layout options in AsP.NeT, 131HtmlPage class
Document property, 106RegisterScriptableObject command, 111–112System.Windows.Browser namespace, 255, 281
HTTPpolling duplex calls, 286retrieving images from HTTP locations, 199WCF polling duplex service, 347–348
HTTP tracers, 570–571Fiddler, 573–574Firebug, 575overview of, 570–571Web Development Helper, 571–573
HttpWebRequest class, 313–314HttpWebResponse class, 313–314HyperlinkButton control, 177–178
IIDe (Integrated Development environment), 7–8IIs (Internet Information services), 299Image control
image handling, 540–542loaded and failed events, 200overview of, 199Stretch property, 199–200
image formats, vs. XAmL, 606–607image handling, 540DeepZoom, 542–546Image and BitmapImage, 540–542
Image_ImageFailed, 200ImageBrush object, 531–533, 540–542ImageSource property, Image control, 540–542ImplicitStyleManager, 239–241inheritance
audio/video properties, 498–500DataContext property and, 375
initialization, of .NeT objects, 33InitializeComponent code, 72–73Ink feature, 258–263
eraser mode, 262–263
InkPresenter, 259–261overview of, 258–259stroke options, 261–262
InkPresenter, 259–261inline styles
applying, 214–218defined, 213limitations of, 218
inline technique, for input validation, 416input component, of presentation core, 15input controlsButton control, 176–177Calendar control, 183–185CheckBox control, 178–179DatePicker control, 186–187HyperlinkButton control, 177–178list of, 172–173PasswordBox control, 176RadioButton control, 179–180RepeatButton control, 180–182Silverlight control categories, 168Slider control, 182–183TextBlock control, 173–174TextBox control, 174–176ToolTip control, 187–188
input devicesdrag-and-drop, 263–266Ink feature, 258–263keyboard, 257–258mouse, 250–256overview of, 250stylus and touch screens, 256
input validation, 416–418installed files, silverlight, 23–24instantiation
.NET objects, 33Silverlight applications, 69–71
instrumentation, performance, 591–592manual timing, 594–596monitoring frame rate, 592–594overview of, 591
instrumentation of code, 587Integrated Development environment (IDe), 7–8integration with AJAX, 249–250integration with AsP.NeT, 470–478
application services, 25authentication, 471, 474–478communication, 26composite controls, 25dynamic generation of XAML from server, 26membership provider, 471–472multiple plug-in navigation, 280–282overview of, 24, 235
77751bindex.indd 629 12/18/08 9:48:49 AM
630
integration with ASP.NET (continued)
integration with AsP.NeT (continued)Profile Provider, 235–239Provider model for security, 470–471role provider, 471role-based security, 472–474server controls, 27
integration with DOm, 15–16intellectual property (IP), 478Intellisense
automating event handler with, 170tools for working with XAML, 57
interaction context, silverlight, 243–244Internet Information services (IIs), 299Interopservices.*, System.Runtime, 18Interval values, RepeatButton control, 181IP (intellectual property), 478IScreen interface, 271Isolated File storage API, 469isolated storage
local data, 392–394security and, 467–469
items controlsComboBox control, 195–196data templates and, 402DataGrid control, 191–193list of, 188–189ListBox control, 189–191Popup control, 196–198ScrollViewer control, 193–195Silverlight control categories, 168
JJava Applets, 516Javascript
adding to a page, 77conditional statements, 79–80DOM (document object model), 77DOM manipulation, 80–83event handling, 80functions, 78vs. managed code, 607–611overview of, 76–77scripts for interacting with properties, 247–248Silverlight extensions, 5Silverlight integration with AJAX library, 249–250validation using dynamic languages, 418variables, 78
Javascript Object Notation (JsON), 249–250JPeG format, 199, 606Jscript, 77JsON (Javascript Object Notation), 249–250DataContractJsonSerializer class, 330–332
overview of, 328–330REST and, 310serializing/deserializing data, 289types of data Silverlight can access and process, 286
Kkey frame animation
color animation using key frame example, 554–555KeyFrames collection, 553–554overview of, 553per-frame animation call back, 555–556
keyboard, 257–258KeyDown, 257KeyeventArgs, 257KeyFrames collection, 553–554KeyUp, 257
LLabel controls, AsP.NeT and Windows Forms, 173language-integrated query. see LINQ (language-
integrated query)languages, localization and, 162layout
ASP.NET options, 130–131performance and, 612–613process in Silverlight, 133–134Silverlight options, 131–132
layout controlsCanvas control, 136–143Grid layout object, 143–149Margin property, 151–152overview of, 136Silverlight control categories, 168StackPanel, 150–151TabControl, 152–154
lazy load, 64libraries
BCL (Base Class Library), 16rich control library in Silverlight, 5SCL (Silverlight Class Library), 8Silverlight integration with AJAX library, 249–250
Line objectdrawing with XAML, 45–46Shape class and, 517
LinearGradientBrush, 528–530LineGeometry, 523LINQ (language-integrated query), 408–412
data query mechanism in .NET Framework 3.5, 22data-processing options, 288dynamic XAML with LINQ, 414–415example manipulating data collection with, 410–412
77751bindex.indd 630 12/18/08 9:48:49 AM
631
mouse
namespaces, 364new in .NET 3.5, 325overview of, 408Silverlight implementation, 409Silverlight support for, 5
LINQ to objects, 409LINQ to sQL, 294, 328LINQ to XmL, 412–414
example querying XML data, 412–414overview of, 412processing XML data, 325–328serializing/deserializing data, 288–289Silverlight support for, 409
list boxes. see ListBox controlListBox control
data control namespaces, 364data templates, 403data-binding example, 380–381scrolling capacity of, 194Silverlight items controls, 189–191
Loaded event, Image control, 200Loadrunner, mercury, 581local data
interacting with hosting computer, 394–396isolated storage, 392–394local resources, 388–391overview of, 388
local resources, 388–391localizable resources, 389localization, of silverlight applications, 161–164look and feel. see styleslookless controls, 224
mmacromedia Flash, 4managed code
accessing Content data, 389adding event handler with, 245code-behind binding, 373–375interacting with properties, 246JavaScript vs., 607–611
manual timing, performance instrumentation, 594–596Margin property, 151–152markup extensions, XAmL, 38–40markup views, expression blend, 56mash-up applications, 289MaxFrameRate, 592–593measure and arrange algorithm, 133media
Expression Media for managing media assets, 129–130media component of presentation core, 13–14unified media format, 6
media controlsImage control, 199–200MediaElement control, 200–202MultiScaleImage control, 203–204overview of, 198ProgressBar control, 202–203Silverlight control categories, 168System.Windows, 521
media server control, AsP.NeT, 500–502MediaElement controlAutoPlay property, 484developers vs. designers, 590events, 511–512Height and Width properties, 487NaturalDuration property, 486overview of, 481–482playback controls, 491–495Position property, 484–486SetSource method, 512–513Silverlight media controls, 200–202Source property, 483–484Stream object, 513streaming services supported, 514Stretch property, 496–498VideoBrush and, 533–534Volume property, 488–490
MediaEnded event, 511MediaFailed event, 511membership provider, AsP.NeT, 471–472memory dump, 567mercury Loadrunner, 581microsoft Application Center Test, 581microsoft Deep Zoom Composer tool, 203–204, 544microsoft expression blend. see expression blendmicrosoft Intermediate Language (msIL), 478microsoft media services (mms), 514microsoft silverlight streaming by Windows Live, 514microsoft Trustworthy Computing initiative, 466–467Microsoft.VisualBasic.dll, 23Microsoft.Windows.Controls
dll assembly, 205themes, 239–241
mms (microsoft media services), 514mobile support, silverlight features, 5modal screens, 275–276mode component, data-binding architecture, 368model View Controller (mVC), 365model View Presenter (mVP), 365ModifiersKeys, 258monitoring frame rate, 592–594mouse, 250–256
browser and platform compatibility and, 256capturing, 254, 260–261
77751bindex.indd 631 12/18/08 9:48:49 AM
632
mouse (continued)
mouse (continued)events, 251–252getting relative positions, 253–254mouse wheel, 254–256overview of, 250triggering storyboards, 252–253
MouseButtonEventArgs, 251MouseEnter
drag-and-drop and, 266mouse events, 251–252
MouseEventArgs, 251MouseLeave
drag-and-drop and, 266mouse events, 251–252
MouseLeftButtonDown, 251–252MouseLeftButtonUp
HitTest, 266mouse events, 251
MouseMove
capturing mouse, 254overview of, 251
MouseOver, visual states and, 445–446mP3 format
audio/video formats, 482MediaElement control, 200Silverlight support for, 6
mscordaccore.dll, 23mscordbi.dll, 23mscorlib.dll, 23mscorrc.debug.dll, 23mscorrc.dll, 23msIL (microsoft Intermediate Language), 478multicore processors, 617multiple From/To/by animations, 551–553multiple plug-in navigation
integration with ASP.NET, 280–282overview of, 280services for, 282–283
MultiScaleImage control, 203–204mVC (model View Controller), 365mVP (model View Presenter), 365
Nnamespaces
overview of, 363XAML, 33–34xmlns command for adding, 375
naming conventions, for user controls, 430NaturalDuration property, MediaElement control, 486navigation
ASP.NET environment and, 266–267multiple plug-in navigation, 280
overview of, 266single plug-in navigation. see single plug-in navigation
nesting, Canvas within Canvas, 138–139.NeT assemblies. see assemblies.NeT Framework
ASP.NET Web Services and, 301code access security, 463–464data classes, 22DLR (Dynamic Language Runtime) and, 22–23elements, 16–17LINQ support added to, 408networking, 21–22role-based security, 463Silverlight based on subset of, 5what is included/excluded in Silverlight, 17–18WPF (Windows Presentation Foundation) and, 18–21XAML for instantiation and initialization of .NET
objects, 33.NeT reflection, 378, 567, 575–576.NeT reflector Tool, 19Network monitor utility, microsoft, 570network sockets. see socketsnetworking, 21–22
ASP.NET. see ASP.NET Web Servicesbuilt-in features, 285–286cross-domain calls, 289WCF service. see WCF service
ngen.exe, 478nodes, Javascript, 80–81npctrl.dll, 23
Oobfuscation techniques, 478–479object models
DOM. see DOM (document object model)Silverlight. see Silverlight Object Model
object oriented programming (OOP), 384OBJECT tags
application instantiation and, 70–71sizing instructions and, 135–136
object tree, silverlight Object model, 85–87ObjectAnimationUsingKeyFrames, 553objects
dragging, 264–265overview of, 36property syntax, 61XAML, 36–37
OleView, 16on-demand XAP loading, 114OneTime data flow, 369OneWay data flow, 369OOP (object oriented programming), 384
77751bindex.indd 632 12/18/08 9:48:49 AM
633
problems. see also troubleshooting
Opacity property, 498, 602–603Open File dialog box, 394overlapping elements, within Canvas control, 140–142overriding set styles, 222–223
Ppackaging silverlight applications, 64–66page
adding JavaScript to, 77basic Silverlight page, 72–76setting styles at page level, 219–222
Page.xaml file, 72–76Panel control, 136parameter, 383parent elements
adding/positioning on Canvas, 139control trees for managing, 171
parser, XAmL, 618–619parsing data, 288parts model
elements parts, 454–458overview of, 454visual states parts, 458–459
PasswordBox control, 176Path class, 521path component, data-binding architecture, 368PathGeometry, 524–526Pause command, MediaElement playback, 202,
491, 495.pdb (Program Database) files, 567–568performance, 589–619
animation and, 597bottlenecks, 590–591chatty applications, 616–617data-binding and, 386–387data-related applications and, 613–616element reuse, 611full screen mode, 603–605game loops and, 598–600height and width and, 605–606improving, 596–597instrumentation, 591–592JavaScript vs. managed code, 607–611layouts and, 612–613manual timing, 594–596monitoring frame rate, 592–594opacity and visibility and, 602–603overuse of assemblies and, 427overview of, 589resources for, 619runtime, 617–618summary, 619text animation and, 597–598
threading and, 607transparent backgrounds, 601–602Windowless controls and, 600–601XAML vs. images, 606–607
per-frame animation call back, 555–556pixels
device-independent, 132raster graphics and, 597–598
platformsclient platform, 11–12mouse handling properties and, 256overview of, 10–11server platform, 11
Play command, MediaElement playback, 202, 491, 495
playback controlASP.NET, 500–501MediaElement, 491–495
Playready technology, Drm (Digital rights management), 15
plug-insattributes, 70–71displaying Silverlight plug-in, 134–136multiple plug-in navigation. see multiple plug-in
navigationsingle plug-in navigation. see single plug-in navigationWindowless controls and, 600–601
PNG format, 199PointAnimation, 550PointAnimationUsingKeyFrames, 553policies
client access policy for socket server, 343–347cross-domain policy files, 290–292
Polygon class, 517–519Polyline class, 519–521Popup control, 196–198Position property, MediaElement control, 484–486positioning methods, 263–266POX (Plain Old XmL), 310predefined styles, 218–219presentation core
DOM integration component, 15–16DRM (Digital Rights Management) component, 14–15input component, 15media component, 13–14overview of, 13UI Core, 13XAML parser, 13
previews, 245Primitives.ButtonBase, System.Windows.Controls, 21problems. see also troubleshooting
vs. errors, 560types of, 560–562
77751bindex.indd 633 12/18/08 9:48:49 AM
634
processors
processorsmulticore, 617performance issues, 591
Profile Provider, AsP.NeT, 235–239programming languages
event handling, 171–172XAML (eXtensible Application Markup Language) as, 32
programming silverlight applicationsBackgroundWorker, 95–100basic Silverlight page, 72–76components of Silverlight applications, 63–64DispatcherTimer, 102–105dynamically loading XAML, 87–89events, 90–92instantiating applications, 69–71interacting with browser from Silverlight, 105–110interacting with Silverlight from browser, 110–114JavaScript and. see JavaScriptobject model base classess, 84–85on-demand XAP loading, 114overview of, 63packaging Silverlight applications, 64–66routed events, 92–94summary, 116–117System.Net.WebClient, 114–115System.Windows.Application class, 66–69System.Windows.Threading, 100–102threading model, 95walking object tree, 85–87
ProgressBar control, 202–203projects, creating, 64properties
adding/changing in Expression Blend, 124–125attached properties, 40–41custom controls, 452–454managed code for interacting with, 245–246scripts for interacting with, 247–248stroke options, 261–262syntax, 37XAML, 36–37
Properties pane, expression blend, 127–128PropertyPath , 370Provider model, AsP.NeT
membership provider, 471–472overview of, 470–471role provider, 471role-based security and, 472–474
proxies, Web servicesASP.NET Web Service, 308–310creating WCF proxy, 305making asynchronous calls with WCF proxy, 305–308
Qqueries, for data retrieval, 408
rRadialGradientBrush control, 530–531RadioButton control, 179–180raster graphics
overview of, 132–133pixels and, 597–598
reach, Web, 4really simple syndication (rss)
how it works, 333–334syndication feed classes, 335–337
receiver class, WCF duplex service, 352–357Rectangle object
adding to Expression Blend design surface, 124adding/positioning elements on Canvas, 136–138drawing with XAML, 43–45overlapping elements on Canvas, 142Shape class and, 517
RectangleGeometry object, 522red Gate’s reflector tool, 575–576references
adding service and web references, 279Web Reference support, 57
reflector tool, red Gate, 575–576registerscriptableObject command, HtmlPage class,
111–112relative positioning, Css, 131remote data
ADO.NET data services, 399–401consuming, 396–399overview of, 396site-of-origin resources, 396
remoting, System.Runtime, 18rendering, resolution-independent, 132RepeatButton control, 180–182representational state Transfer. see resT
(representational state Transfer)resolution, 132resources
local resources, 388–391site-of-origin resources, 396StaticResources command, 376–377
resT (representational state Transfer), 310–314ADO.NET Data Services and, 399, 400development of, 287HttpWebRequest and HttpWebResponse classes,
313–314options for calls between Silverlight applications and
data repository, 286
77751bindex.indd 634 12/18/08 9:48:49 AM
635
server communication
Silverlight support for, 22transforming DataContracts into XML, 399Web Services and, 310WebClient class, 311–313
reusabilityof elements, 611of user controls, 428
rIAs (rich Internet Applications)comparing performance of, 619Silverlight support for, 4transforming web application into, 24
rich clients, Web reach compared with, 4rich Internet Applications. see rIAs (rich Internet
Applications)roeder, Lutz, 19role provider, AsP.NeT, 471–472role-based security
ASP.NET, 472–474code access security compared with, 463
root elements, of controls, 226RotateTransform, 535–536routed events
bubbling routing strategy, 92–94example of, 171user interaction and, 245
rowsdefining in Grid, 144properties, 145–146sizing Row and Column elements, 146–149
rss (really simple syndication)how it works, 333–334syndication feed classes, 335–337
runtime performance, 617–619runtime problems, 560–561
ssaas (software as a service), 6sandbox environment
security and, 467–470Silverlight running in, 244
ScaleTransform, 537–538scaling contents, display modes and, 159–161scenarios
custom controls, 447–448customizing current controls, 436–437user controls, 428
sCL (silverlight Class Library), 8screen dimensions, 157–158. see also display modesscreens on demand, from serve, 276–280<script> tags, 77scripting languages, 77. see also Javascriptscripts, for interacting with properties, 247–248
ScrollViewer control, 193–195secure by Default, microsoft Trustworthy Computing
initiative, 467secure by Deployment, microsoft Trustworthy
Computing initiative, 467secure by Design, microsoft Trustworthy Computing
initiative, 467security
class definitions and, 465–466code access security, 463–464cross-domain, 470cryptography, 479exploitations, 461–462integration with ASP.NET, 470–478levels in Silverlight, 464–465Microsoft Trustworthy Computing initiative, 466–467obfuscation techniques and tools, 478–479overview of, 461–479role-based security, 463sandbox environment and, 467–470summary, 479what you continue to use ASP.NET for, 6–7
securityCritical level, silverlight security levels, 465securitysafeCritical level, silverlight security levels,
464–465securityTransparent level, silverlight security levels,
464sender parameter, 245serializing/deserializing data
ASP.NET Web Services and, 301DataContractJsonSerializer class, 328–329serialization namespaces, 364Silverlight options for, 288–289System.Runtime, 24XmlSerializer class, 318–325
server communication, 285–359ASP.NET. see ASP.NET Web Servicesclient access policy socket server, 343–347cross-domain support, 289–290data-processing options, 288–289domains and URLs supported, 286Flash cross-domain policy files, 290JSON data, 328–332LINQ to XML, 325–328making RESTful calls, 310–314options for, 286–288overview of, 285RSS and ATOM syndication feeds, 333–335services for, 292Silverlight cross-domain policy files, 291–292sockets for communicating over TCP, 337–338sockets in a Silverlight client, 340–343sockets on a server, 338–340
77751bindex.indd 635 12/18/08 9:48:49 AM
636
server communication (continued)
server communication (continued)summary, 343–347syndication feed classes, 335–337syndication feeds, 332WCF duplex service for Silverlight. see WCF duplex
service for SilverlightWCF service. see WCF servicewhat types of data are accessible by Silverlight, 286XML data, 314XmlReader class, 314–318XmlSerializer class, 318–325
server controls, AsP.NeT integration with silverlight, 27server platform, silverlight architecture, 11servers, sockets on, 338–340server-side pages, referencing, 50–55service contract, WCF service, 294–295service factory, WCF duplex service, 350–352service Level Agreements (sLAs), 562services, for multiple plug-in navigation, 282–283SetSource method, 512–513Setter object, 219, 437Setter proprety, Style object, 219shapesEllipse object, 41–43Geometry objects compared with, 521Line object, 45–46overview of, 517overview of Shape class, 41Polygon class, 517–519Polyline class, 519–521Rectangle object, 43–45Shape class, as base class, 41System.Windows.Shapes, 517
silverlight, introduction tochallenge of creating rich user interface, 3–4development environment, 7–8high-level features, 4–5impact on existing ASP.NET applications, 5overview of, 3rich client vs. Web reach, 4summary, 8what you continue to use ASP.NET for, 6–7
silverlight Class Library (sCL), 8silverlight Object model
base classess, 84–85dynamically loading XAML, 87–89overview of, 84walking object tree, 85–87
silverlight resources, 389silverlight Tools for Visual studio 2008
‘Add a New ASP.NET Web Project to the Solution to Host Silverlight’, 563–564
‘Automatically Generate a Test Page to Host Silverlight at Build Time’, 564–565
debugging applications with, 566–570‘Link This Silverlight Control into an Existing Web Site’,
565–566overview of, 7
Silverlight.Configuration.exe, 23Silverlight.ConfigurationUI.dll, 23single plug-in navigation
effects for enhancing user navigation, 273–275overview of, 267–268screens on demand from server, 276–280simulation of modal screens, 275–276transitioning user controls, 268–273
site-of-origincross-domain calls and, 289resources, 396
SkewTransform, 536–537skins. see also templating
of controls, 213customizing current controls, 440–443example mixing styling and skinning, 443–444lookless controls, 24
sLAs (service Level Agreements), 562Slider control
for media volume and balance, 489–490Silverlight user input controls, 182–183
slr.dll.managed_manifest, 24smIL (synchronized multimedia Integration
Language), 516sOAP (simple Object Access Protocol)
ASP.NET Web Service proxy and, 309ASP.NET Web Services and, 301calling Web Services and, 304data-processing options, 288REST and, 310types of data Silverlight can access and process, 286
sOAP messages, 21sockets
client access policy for, 343–347for communicating over TCP, 337–338on a server, 338–340in a Silverlight client, 340–343
software as a service (saas), 6SolidColorBrush, 526–528sos.dll, 23source component, data-binding architecture, 368Source property, MediaElement control, 483–484ssL, 462StackPanel control
layout options in Silverlight, 132layout performance issues, 612orientation setting for ListBox control, 191overview of, 150–151ScrollViewer control and, 193
77751bindex.indd 636 12/18/08 9:48:50 AM
637
System.Windows.FrameworkElement
standardsExpression Web validation, 122HTML, 10–11
statesMediaElement events, 511visual styles connected to button state, 445–447
static positioning, Css, 131StaticResources command, 376–377Stop command, MediaElement playback, 202, 491,
495storage. see data storage/retrievalStoryBoad object, 548storyboards
animation contained in StoryBoard object, 548creating new, 59triggering, 252–253
Stream object, MediaElement, 513streaming media
services, 514Silverlight features, 5
Stretch propertyImage control, 199–200MediaElement control, 496–498
strings, converting string values into object types, 37strokes
creating new stroke objects, 261drawing in XAML, 42modifying properties of, 261–262
Style objectcustomizing with, 437overriding set styles, 222–223predefined styles, 218–219Setter property, 219setting styles at page level, 219–222
Style property, FrameworkElement class, 219style sheets, 213styles, 212–224
applying inline styles, 214–218built-in styles, 451–452customizing current controls, 437–440default styles, 438ImplicitStyleManager, 239–241mixing styling and skinning, 443–444overriding set styles, 222–223overview of, 212–213setters, 219setting at application level, 223–224setting at page level, 219–222specifying in a central location, 218–219summary, 242visual styles connected to button state, 445–447
stylus, input devices, 256StylusDevice property, 256
svcutil.exe, 294symbol files, 567–568synchronized multimedia Integration Language (smIL),
516syndication feeds
classes, 335–337overview of, 332RSS and ATOM syndication feeds, 333–335
syndication services, 22SyndicationFeed
data-processing options, 289RSS and ATOM syndication feeds and, 335
SyndicationItem, 335syntax
property elements, 37XAML, 33
System.Core.dll, 23System.Data, 17System.Deployment.*, 17System.Diagnostic, 587system.dll, 24System.Net
Silverlight installed files, 24Sockets, 338, 340WebClient, 114–115
System.Object, 19System.Runtime
InteropServices.*, 18Remoting, 18Serialization, 24Serialization.Json, 328
System.Security
ASP.NET elements omitted from Silverlight 2, 18CAS functionality, 464Cryptography, 479
System.ServiceModel.dll, 24System.Windows.Application class, 66–69System.Windows.Automation, 586System.Windows.Browser namespace, 105HTMLPage, 281HtmlPage class, 255, 281
System.Windows.Browser.dll, 24System.Windows.Controls
Button, 21Calendar and DatePicker controls in, 186ContentControl, 20–21Control, 20Data, 403Image, 540–542Primitives.ButtonBase, 21
System.Windows.DependencyObject , 19System.Windows.dll, 24System.Windows.FrameworkElement, 20
77751bindex.indd 637 12/18/08 9:48:50 AM
638
System.Windows.Media.Geometry
System.Windows.Media.Geometry, 521System.Windows.Shapes.Shape, 517System.Windows.Thickness, 151System.Windows.Threading, 100–102System.Windows.Threading.Dispatcher, 100–102System.Windows.UIElement, 20System.Xml.dll, 24System.Xml.Serialization, 320
TTabControl control, 152–154tables, HTmLGrid layout object compared with, 143overview of, 131
TabPanel control, 136, 152tags, use of short cut tags, 169target object, data-binding architecture, 368target property, data-binding architecture, 368TargetType property
conversions and, 383custom controls, 452Style object, 218styles and, 437
TCPclient access policy for socket server, 343–347sockets for communicating over, 337–338
TcpClient, 338–340TcpListener, 338–340TDD (Test Driven Development)
overview of, 576UI testing, 581–586unit testing, 576–581
TemplateBinding syntax, 232–234, 441–442templates
data templates, 402–403ListBox control, 189–190summary, 242tools for working with XAML, 57
TemplateVisualState, 458templatingControlTemplate class, 224customzing with skins, 440–443generic.xaml, 227–232lookless cotnrol, 224overview of, 224TemplateBinding syntax, 232–234using, 225–227VisualState objects, 224–225
terminology, XAmL, 33text animation, performance and, 597–598TextBlock
adding to Expression Blend design surface, 126
adding to page, 58–59ASP.NET, 173creating user control with, 271layout process in Silverlight, 133–134overview of, 173–174placing in Grid, 145scaling contents to take advantage of screen modes,
157–161TextBox
applying inline styles to, 214–215keyboard input and, 257multiple Style objects and, 222overview of, 174–176
themesASP.NET, 214Microsoft.Windows.Controls, 239–241
Thickness, System.Windows, 151threading model, 95–105BackgroundWorker, 95–100DispatcherTimer, 102–105overview of, 95performance and, 607System.Windows.Threading, 100System.Windows.Threading.Dispatcher, 100–
102threat modeling, 462timeline
animations and, 547creating new, 59
timeline markersExpression Encoder, 504–506overview of, 503via code, 506–510Windows Media File editor, 503–504
timers, DispatcherTimer, 102–105ToggleButton base class, 178, 179Toolbox, Visual studio 2008, 205toolkit, for troubleshooting, 562
Fiddler, 573–574Firebug, 575HTTP tracers, 570–571Red Gate’s Reflector tool, 575–576Visual Studio 2008 as debugger, 563–566Web Development Helper, 571–573
toolkit controlsAutoCompleteBox control, 206–207Chart control, 210–212list of, 205–206TreeView control, 208–210WrapPanel control, 207–208
tools, XAmL, 56–57ToolTip control, 187–188touch screens, 256
77751bindex.indd 638 12/18/08 9:48:50 AM
639
user input controls
Transform
overview of, 535RotateTransform, 535–536ScaleTransform, 537–538SkewTransform, 536–537TranslateTransform, 539–540
TranslateTransform, 539–540transparent backgrounds, 601–602TreeView control, 208–210troubleshooting, 559–587
debugging applications, 566–570exception handling, 586–587Fiddler, 573–574Firebug, 575HTTP tracers, 570–571instrumentation of code, 587overview of, 559–560Red Gate’s Reflector tool, 575–576summary, 587toolkit for, 562types of problems, 560–562UI testing, 581–586unit testing, 576–581Visual Studio 2008 as debugger, 563–566Web Development Helper, 571–573
truecolor, Image control, 199TwoWay binding mode
conversions and, 382data flow and, 369data-binding example, 381
type converters, XAmL, 37–38Type Library, 16
uuI (user interface)
animation and graphics and, 516Canvas control, 136–143challenge of creating rich user interface, 3–4customization scenario, 436display modes, 154Embedded display mode, 154Expression Blend, 123–129Expression Design, 129Expression Encoder, 130Expression Media, 129–130Expression Studio, 130Expression Suite compared with Visual Studio,
121–122Expression Web, 122Full-screen display mode, 154–161Grid layout object, 143–149hosting plug-in and, 134–136
layout controls, 136layout option in ASP.NET, 130–131layout option in Silverlight, 131–132layout process in Silverlight, 133–134localization, 161–164Margin property, 151–152overview of, 121resolution-independent rendering, 132StackPanel, 150–151summary, 165–166TabControl, 152–154unresponsive due to bottleneck, 591vector graphics, 132–133
uI Core, 13uI testing, 581–586uI Virtualization, 616UIElement
handling user interaction, 244–245layout of child elements and, 613MediaElement deriving from, 498–500mouse and, 250overview of, 244Shape class inheriting from, 517Silverlight Object Model, 84styles, 436System.Windows, 20
uniform resource Indicators (urIs), 483uniform resource Locators (urLs), 33unit testing, 576–581updates, silverlight, 28–29urIs (uniform resource Identifiers), 483
REST and, 287urLs (uniform resource Locators), 33
REST and, 287supported by Silverlight, 286
user controls. see also user interactionadding to project, 429–430basic Silverlight page, 72benefits of, 425creating, 429customizing, 431–434deploying, 427loading at runtime, 48loading screens on demand from server, 276–280overview of, 423–424scenarios for use of, 428in Silverlight, 426–427transitioning for navigation, 268–273XAML root element, 33–34
user input controlsButton control, 176–177Calendar control, 183–185CheckBox control, 178–179
77751bindex.indd 639 12/18/08 9:48:50 AM
640
user input controls (continued)
user input controls (continued)DatePicker control, 186–187HyperlinkButton control, 177–178list of, 172–173PasswordBox control, 176RadioButton control, 179–180RepeatButton control, 180–182Silverlight control categories, 168Slider control, 182–183TextBlock control, 173–174TextBox control, 174–176ToolTip control, 187–188
user interaction, 243–283AJAX and, 249–250consuming properties, 245–246dependency properties, 247drag-and-drop, 263–266effects for enhancing user navigation, 273–275handling, 244–245Ink feature, 258–263with input devices, 250integration with ASP.NET, 280–282keyboard, 257–258mouse, 250–256multiple plug-in navigation, 280navigation in ASP.NET environment, 266–267overview of, 243screens on demand from server, 276–280scripts for interacting with properties, 247–248services for, 282–283Silverlight interaction context, 243–244simulation of modal screens, 275–276single plug-in navigation, 267–268stylus and touch screens, 256summary, 282–283UIElements events, 244user control transition for navigation, 268–273
user interface. see uI (user interface)UserControl. see user controls
Vvalidation
data-binding validation, 419–420dynamic languages and, 418–419input validation, 416–418overview of, 416standards validation in Expression Web, 122
value parameter, 383var keyword, 78variables, Javascript, 78vector graphics
drawing objects with, 129Expression Blend and, 56
raster graphics compared with, 132–133XAML vs. images, 606–607
video formats, 201, 482. see also audio/videoVideoBrush, 533–534viewport, scrolling area, 193Visibility property, 602–603, 605visual customization, 435–436visual state management, 445–447Visual state manager, 454, 459visual states parts, parts model, 458–459Visual studio 2008Add Service References tool, 308–309configuring WCF service, 298–299creating new Silverlight project, 58creating proxy object for Web Service calls, 286as debugger, 563–566debugging applications with, 566–570editing code and, 56–57Expression Suite compared with, 121–122as IDE for Silverlight, 7–8interoperability with Expression Blend, 56, 59project explorer, 424support for creating ASP.NET Web Services, 301tools for working with XAML, 56–57
Visual studio Test edition (Web Testing), 581VisualState objects, 224–225VisualStateManager, 445Volume property, MediaElement control, 488–490
WW3C (World Wide Web Consortium)
animation standards, 516Expression Web compliance with, 122HTML standards, 10–11
WCF (Windows Communication Foundation)authentication and, 474–475.NET Framework and, 17networking and, 21overview of, 292–293service for consuming remote data, 397traditional data handling and, 408
WCF duplex service for silverlightcontracts for, 347–348creating receiver class, 352–357creating service, 348–349creating service factory, 350–352overview of, 347processing data using XmlSerializer class, 357–
359WCF service
calling with Silverlight, 304–305configuring, 298–299creating, 295–298
77751bindex.indd 640 12/18/08 9:48:50 AM
641
XAML
creating WCF proxy, 305data contract, 293–294making asynchronous calls with WCF proxy, 305–308overview of, 293self-hosted, 299–301service contract, 294–295
Web Development Helper, 571–573Web reach, 4Web reference support, 57Web service Description Language (WsDL), 286, 301Web services
ASP.NET. see ASP.NET Web Servicesconsuming remote data, 397networking and, 21options for calls between Silverlight applications and
data repository, 286options for data exchange, 287–288overview of, 292REST and, 310WCF duplex service for Silverlight, 348–349WCF service. see WCF service
web tracing tools. see HTTP tracersweb user controls, 424WebClient class, 311–313WebClient class, System.Net, 114–115WebGetAttribute class, 299WebMethods, AsP.NeT Web services, 302–303WF (Windows Workflow Foundation), 17white space handling, XAmL, 34–36Width property
drawing in XAML, 41MediaElement control, 487performance and, 605–606
Windowless controls, 600–601Windows Communication Foundation. see WCF
(Windows Communication Foundation)Windows Forms, 202Windows media Audio. see WmA (Windows media
Audio) formatWindows media Digital rights management
(WmDrm), 14–15Windows media File editor, 503–504Windows media metafiles, 482Windows media Video. see WmV (Windows media
Video) formatWindows Presentation Foundation. see WPF (Windows
Presentation Foundation)Windows Workflow Foundation (WF), 17WinForms, 95WmA (Windows media Audio) format
audio/video formats, 482MediaElement control, 200–201Silverlight support for, 6
WmDrm (Windows media Digital rights management), 14–15
WmV (Windows media Video) formataudio/video formats, 482DRM and, 14MediaElement control, 200–201Silverlight support for, 6
World Wide Web Consortium. see W3C (World Wide Web Consortium)
WPF (Windows Presentation Foundation)customization and, 437data binding and, 386ImplicitStyleManager, 239–241navigation services, 267.NET Framework and, 17overview of, 18–21routed events and, 92runtime performance and, 617styles, 440threading model, 95WPF-like graphics in Silverlight, 5XAML at heart of, 32XAML parser and, 13
WrapPanel control, 207–208WsDL (Web service Description Language), 286, 301
XX and Y coordinates
drawing in XAML, 45GetPosition method, 253–254positioning elements with, 136
x objects, LINQ to XmL, 413XAmL (eXtensible Application markup Language),
31–62applying inline styles, 214–215attached properties, 40–41child objects in, 269code behind and, 46–49data-binding, 375–377defining controls, 169–170developers knowing basics of, 31–32drawing basics, 41dynamic XAML with LINQ, 414–415dynamically generating, 26dynamically loading, 49–50, 87–89element reuse and, 611Ellipse object, 41–43example, 57–62function of XAML parser, 13vs. images, 606–607Line object, 45–46local resources, 389markup extensions, 38–40
77751bindex.indd 641 12/18/08 9:48:50 AM
642
XAML (eXtensible Application Markup Language) (continued)
XAmL (eXtensible Application markup Language) (continued)
namespaces, 33–34object and property elements, 36–37overview of, 31parser, 618–619as programming language, 32Rectangle object, 43–45referencing server-side page that dynamically creates
XAML, 50–55Silverlight user interface defined in, 6syntax and terminology, 33tools for working with, 56–57type converters, 37–38white space, 34–36
.xaml file, 72–76XAP files
caching, 401local data and, 388on-demand XAP loading, 114retrieving images from, 199
x:class attribute, 72XDocument object, 325–326, 413XHTmL+smIL, 516x:Key
applying unique key to Style object, 218–219multiple styles and, 222styles and, 439
XmL (extensible markup Language)ASP.NET Web Services and, 301binding from, 415LINQ to XML features, 22, 412–414namespaces, 363–364processing XML data, 314types of data Silverlight can access and process, 286XML visualization tools in Expression Web, 122XmlReader class, 314–318XmlSerializer class, 318–325
XmL Paper specification (XPs), 31XmL schemas, 294XmlHttpRequest object, 289Xml.Linq, 363xmlns attribute, 33
xmlns command, 375XmlPreloadedResolver, 364XmlReader class
data-processing options, 288–289processing XML data and, 314–318Silverlight data classes, 22
XmlReaderSettings, 363XmlResolver, 363XmlSerializer class
data-processing options, 288–289processing data using, 357–359server communication of XML data, 318–325
XmlWriter class, 288XmlXapResolver, 364x:Name
defining control names, 169MediaElement control and, 483property, 74
XNamespace, 413XPs (XmL Paper specification), 31xsd.exe, 320, 358XsLT (extensible stylesheet Language
Transformation)LINQ and, 364real-time standarads validation in Expression Web,
122
Yy coordinates. see X and Y coordinates
ZZIP packages, 64zooming
Deep Zoom, 203–204, 542–546MultiScaleImage control, 203$>, 413
XPs (XmL Paper specification), 31xsd.exe, 320, 358XsLT (extensible stylesheet Language
Transformation)LINQ and, 364real-time standards validation in Expression Web, 122
77751bindex.indd 642 12/18/08 9:48:50 AM