intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Essential Silverlight 3- P8

Chia sẻ: Thanh Cong | Ngày: | Loại File: PDF | Số trang:20

76
lượt xem
13
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Essential Silverlight 3- P8: Khái quát Silverlight 3 không chỉ là lấp đầy với các chi tiết kỹ thuật, ví dụ rõ ràng, và thực hiện lời khuyên rằng sẽ làm cho bất kỳ ứng dụng Silverlight tốt hơn, nhưng Ashraf cũng bao gồm những hiểu biết rằng chỉ có thể đến từ một trong những nhà phát triển dẫn của thời gian chạy Silverlight. Từ đồ họa, văn bản, để phương tiện truyền thông cuốn sách này- có tất cả các thông tin cần thiết về thời gian chạy lõi 3 Silverlight....

Chủ đề:
Lưu

Nội dung Text: Essential Silverlight 3- P8

  1. Index 269 Button element as subclass of, 204–206 C creating custom control by inheriting C# from, 207 CLR for writing code in, 2 data binding and, 203 defining event handler for input events, 119 overview of, 199–201 writing application code, 5, 36 ContentPresenter element, 200 CacheMode property, UIElement, 254–259 Control base class, 195 Caching glyphs and character related Controls information, 112 adding to media players, 183–187 Canvas element built-in, 196–197 BlurEffect nested in, 249 ContentControl, 199–201, 203 creating custom XAML elements, 27–28 custom, 198 limitations of and when to use, 158–159 custom controls for input events, 117 measure and arrange passes and, 176 customizing built-in, 207–209 opacity and, 79 elements, 198–199 overview of, 72 focus of, 127 positioning elements with, 158 GoToState method of visual state RenderTransform example, 73 manager, 210–211 ClearType instantiation of, 209–210 readability of text and, 113 ItemsControl, 201–203 support in Silverlight 3, 99 keyboard event handlers, 126 Clipping, graphics display area, 77–78 overview of, 195–196 Closed captioning, 178 principles, 196 CLR (Common Language Runtime) review, 211 data sources and, 214 Silverlight 3 features, 9 options for writing application code, 36 in Silverlight toolkit, 197 writing code in C# or Visual Basic, 2 sliding menu of, 131 writing Silverlight code in, 7 styling, 206–207 Code UI controls in applications, 13 execution, 12–13 VisualStateManager and, 203–206 writing application code, 5, 36 CornerRadius property, 160 writing code in C# or Visual Basic, 2 CPUs writing code using CLR, 7 access to system memory, 264 Collections, binding with ItemsControl, GPU capable of higher fill rates than 221–224 CPUs, 252 ColorA nimation element, 140–141 multi-core rendering, 94–95 Colors SIMD (Single Instruction Multiple Data) adding to text, 105 and, 234 animating brush color, 150 Cross platform solid color brushes, 64 applications, 13 ColumnDefinition properties, Grid graphics, 47 element, 164–165 input events, 117 Comboboxes, binding data to, 223–224 Silverlight and, 5–6 Common Language Runtime. See CLR text, 98 (Common Language Runtime) CurrentStateChanged event handler, 186 Connections, data source, 214 Cursors, flashing, 131 Content delivery, media, 178–179 Custom Content property, ContentControl animation, 135–136 element, 199–201 easing functions, 147 ContentControl element
  2. 270 Index Custom (continued) Debugging, HLSL pixel shader, 244–245 fonts, 106 Declarative XML instantiation language. layout, 169–173 See XAML XAML classes, 27–30 Deep Zoom Composer Custom controls creating images in deep zoom format, 7 creating, 198 tools for creating Silverlight content, 1 for input events, 117 Dependency properties, binding parameters to, 245–246 Deployment D deploying applications, 12 Dashes, added to strokes, 71–72 Web deployment of Silverlight Data binding applications, 3 automatic connection and synchronization Deployment packages. See XAPs and, 214 (deployment packages) binding collections, 221–224 Deployment.OutOfBrowserSettings Binding object and, 229–230 property, 21 connecting data to elements, 215–218 Designers, collaboration in application ContentControl element and, 203 development, 13 data sources and, 214 Developers, collaboration in application data synchronization and binding modes, development, 13 219–221 Development, ease of Silverlight data validation and, 227–228 development, 5 DataContext inheritance, 218 Digital Rights Management (DRM) declarative XAML model and, 214–215 media delivery and, 179 element to element binding, 228–229 media source and, 182 ItemsControl element and, 203, 230–231 Direct X overview of, 213 HLSL (High Level Shader Language) pixel principles, 213–214 shader. See HLSL (High Level Shader review, 230 Language) pixel shader Silverlight 3 features, 9 prerequisites for GPU acceleration, 253 value converters and, 225–227 for use with Windows OSs, 263 Data files, XAPs (deployment packages) Display and, 30 clipping display area, 77–78 Data services, 13 connecting video markers to application Data sources display, 189–190 connecting to elements, 215 Dots per inch (DPI), image formats and, 62 creating collection-based data source, Double, type conversion, 25–26 222–223 DoubleA nimation element for data binding, 214 BeginTime property, 144 Data synchronization linear interpolation based on From and To automatic connection and values, 140–141 synchronization, 214 overview of, 137 data binding and, 219–221 DoubleA nimationUsingKeyFrames Data validation, 227–228 element, 141–142 Data values, converters for, 225–227 Downloader, application, 34–35 DataContext property DownloadProgress, MediaElement, 187 FrameworkElement, 215–216 DPI (dots per inch), image inheritance and, 218 formats and, 62 DateTime object, time format in, 137 Draw loop process, in graphics, 82–83
  3. Index 271 DRM (Digital Rights Management) creating custom XAML elements, 27–28 media delivery and, 179 drawing, 50–51 media source and, 182 element tree model when drawing, 36 Dropout control, readability of limiting HLSL pixel shader to ellipse shape, text and, 113 239–240 DropShadowEffect stroke widening process applied to, 70 built-in effects, 234–235 EnableCacheVisualizaion flag, on performance and, 250 plug-in, 260 running, 249 EnableFrameRateCounter flag, on plug-in, Durations, animation, 137 260 EnableGPUA cceleration flag, on plug-in, E 253–254 EaseMode properties, 146 EvenOdd rule, fill rules, 59, 61 Easing functions Event bubbling, mouse, 124–125 creating custom, 147 Event handlers list of, 146 CurrentStateChanged event for nonlinear interpolation animations, handler, 186 144–146 delegating control actions to event East Asian fonts, 98, 106 handlers, 184 Effect property, UIElement, 234, 238 keyboard, 126 Effects. See also HLSL (High Level Shader MarkerReached event handler, 189–190 Language) pixel shader mouse, 120 applying, 234–235 options for input events, 118–119 BlurEffect and DropShadowEffect, 249 XAML, 26–27 built-in, 234 Events creating, 236 application, 37 elements, 234 input. See Input events overview of, 233 layout, 173–174 principles, 233 startup and exit, 18 real-time speed, 233–234 triggers responding to, 137 review, 249 Exit event, saving state when leaving Silverlight 3 features, 7 applications, 18 surface generation, 248 Expression Blend Element tree, applications, 36 creating Silverlight content, 1 Elements creating Silverlight graphics, 7, 47 animation, 136–138 customizing controls, 198 binding data to, 215–218 editing application layout and graphic changing size, 151 design, 13 connecting data sources to, 215 editing XAML with, 18 control, 198–199 Silverlight development and, 5 effect, 234 Expression Design element to element data binding, 228–229 creating Silverlight content, 1 graphics, See Graphics as Silverlight graphics tool, 7, 47 layout, 158 Expression Media Encoder media, 180 connecting video markers to application text, 99–100 display, 189 Ellipses creating Silverlight content, 1 animation changing rectangle into, 143–144 generating default media player with, 180
  4. 272 Index SetBinding property, 229 F Full screen Figure element, Shapes, 58 adding capability to video player, 188–189 File formats delivering full screen experience, 179–180 audio files, 9 performance and, 189 image files, 62 fxc.exe, DirectX compiler, 237 Fill property, Shape element, 48 Fills fill rules for shapes, 58–61 G solid color brushes, 63 Gamma correction, for anti-aliased text, 113 Filters, bilinear, 88–92 Gaussian blur, BlurEffect, 235 Flashing cursors, 131 GDI (Graphics Device Interface), 99 float types, HLSL pixel shader and, 240 Geometry Floating-point parameter, defining for converting to pixels, 83 effects, 245 type conversion, 25–26 Focus GetPosition method, for information on controlling keyboard focus, 127 mouse position, 123–124 releasing/calling, 116 Glyphs element FontFamily property, 106 for advanced typography, 97 Fonts caching glyphs, 112 caching and, 112 displaying mathematical formula with, cross-platform consistency, 98 107–110 downloading, 111–112 font download, 111–112 enumerating font files, 110–111 function of, 107 fallback list, 111 OriginY property, 110 FontFamily and FontSize properties, uniform scaling, 98–99 106–107 GoToState method, of FontWeight and FontStyle properties, VisualStateManager, 207–211 104–105 GPU acceleration readability and, 99 better performance with, 252 XAPs (deployment packages) and, 30 CacheMode property, 254–259 FontSize property, 106–107 creating graphic devices and, 263 FontStyle property, 104–105 diagnosing performance problems, FontWeight property, 104–105 259–263 Foreground property, adding color to enabling, 253–254 text, 105 image quality and, 252 Formats multiple monitors and, 265 audio files, 9 overview of, 251 image files, 62 prerequisites for, 253 Formats, time, 137 principles, 251–252 Formatting text, 103–105 rendering stages when enabled, 265 Frame-based animation, vs. time-based, review, 265 132–134 Silverlight 3 features, 7 Framerates, diagnosing performance stability and, 252–253 problems, 259 video memory allocation and, 264 Frames per second, setting property change video performance and, 189 speed for animation, 149 GPU (graphics processing unit) FrameworkElement bilinear filtering and, 252 DataContext property, 215–216 rendering graphics with, 251
  5. Index 273 GPU (continued) Graphics Device Interface (GDI), 99 video memory and, 254 Graphics drivers, 252–253 Gradient brushes Graphics processing unit. See GPU (graphics focal, 67 processing unit) linear, 65–66 Grid element, 162–167 radial, 66–67 arranging Button elements in grid pattern, SpreadMethod property, 68 162–163 Graphic devices, creating, 263 centering TextBlock in cell of, 166 Graphics as child of another element, 163–164 3D transforms, 75–77 having single element span multiple animation, 8 columns or rows, 163 balancing image quality and speed, 47–48 positioning elements in grid pattern, 162 bilinear filtering, 88–92 setting maximum widths and heights, 167 brushes, 62 specifying row/column widths/heights, Canvas element, 72 164–165 clipping, 77–78 text layout and, 103 cross platform consistency, 47 dashes added to strokes, 71–72 draw loop process, 82–83 H ellipses, 50–51 H264 video fill rules, 58–61 media delivery and, 178 getting content to screen, 95 as media source, 182 gradient brushes, 65–68 Silverlight 3 media features, 9, 177 image brushes, 68–69 HD video, 8, 177 images, 61–63 Height property immediate mode API, 43–44 automatic sizing and positioning of incremental redraw, 92–94 elements, 174 library, 12 ImageElement, 62 lines, 51–55 MediaElement, 181 multi-core rendering, 94–95 High Level Shader Language. See HLSL (High occlusion culling, 94 Level Shader Language) pixel shader opacity, 79 Hinting, TrueType program for, 112 OpacityMask property, 79–81 Hit-testing, mouse events, 125–126 overview of, 41 HLSL (High Level Shader Language) pixel Path element, 55–58 shader principles, 41 applying, 237–238 rasterization, 83–88 binding parameters to dependency rectangles, 48–50 properties, 245–246 retained mode API, 43–47 code for, 236 review, 96 compiling, 237 shapes, 48 debugging, 244–245 Silverlight 3 features, 7 defining inputs to, 242–243 solid color brush, 63–64 functions of, 236 strokes, 69–71 image distortion effect, 247 tools for, 47 limiting effect to ellipse, 239–240 transforms, 73–75 list of common functions, 240–242 vector graphics and bitmap images, 41–43 Mask property applied to image brush, Graphics adapters, multiple monitors 243–244 and, 265 tex2D function, 240
  6. 274 Index HorizontalA lignment property, Grid custom controls, 117 element, 166 event handler options for, 118–119 HTML controls, Silverlight controls hit-testing mouse events, 125–126 compared with, 9 keyboard event handlers, 126 HTML page keyboard event process, 129 application components, 16 mouse capture, 119–124 in structure of Silverlight applications, 20 mouse event bubbling, 124–125 Web deployment of Silverlight mouse event handlers, 120 applications, 12 mouse event process, 128 multiple languages and, 118 overview of, 115 I principles, 115–116 Illustrator (Adobe), exporter for XAML receiving Web browser events, 116–117 files, 47 review, 130 Image distortion effect, HLSL pixel shader, Silverlight 3 features, 8 247 Instantiation Image element of controls, 209–210 applying effect directly to, 249 XAML parser and, 35 overview of, 61–63 Internet Explorer, 35. See also Web browsers video samples compared to, 191 Interpolation animations ImageBrush element easing functions for nonlinear animation, Mask property applied to, 243–244 144–146 overview of, 68–69 linear interpolation based on From and VideoBrush compared with, 191 To values, 140–141 Images overview of, 140 balancing image quality and IsHitTestVisible property, 126 speed, 47–48 Italic format, text, 104 bitmap images, 41–43 Items collection, 202 GPU acceleration improving image ItemsControl element quality, 252 binding data to collections, 221–224 resolving seaming problems due to binding data to comboboxes, 223–224 non-integer positioning, 168–169 binding data to lists, 222, 230–231 scaling, 42–43 creating custom control by inheriting Immediate mode graphics API from, 207 compared with retained mode, 45 data binding and, 203 overview of, 43 data validation and, 227 removing rectangle with, 44 overview of, 201–203 Incremental redraw, graphic ItemsPanel element, 202 objects, 92–94 ItemsPresenter element, 202 Inheritance ItemsSource property, ItemsControl DataContext property and, 218 element, 222, 230 TextBlock element and, 105 ItemsTemplate property, 202 Initialization, XAML parser and, 35–36 IValueConverter, converting from INotifyCollectionChanged, 230 Priority type to Brush type, 225–226 INotifyPropertyChanged, 219–220 Input events accessibility and, 127 J asynchronous firing, 129 JavaScript, accessing application libraries controlling keyboard focus, 127 from, 5 cross-platform consistency, 117 JPG image format, 62
  7. Index 275 Libraries, Silverlight, 12–13 K Linear gradient brushes, 65 Keyboard LineBreak element, TextBlock asynchronous firing, 129 element, 101 controlling focus, 127 Lines, drawing, 51–55 cross-platform consistency, 117 LINQ (Language Integrated Query), 214 delegation to appropriate element, 117 LINQ to SQL, 214 event handlers, 126 LINQ to XML, 214 input events and, 8 Linux, 5–6 multiple language support, 118 List controls, ItemsControl element for, process of, 129 201–203 receiving Web browser events, 116 ListBox element KeyDown event handler, 126, 129 data binding and, 231 Keyframe animations implementing, 199 animation between different objects, Lists, binding data to, 222 143–144 Live broadcast streaming. See Broadcast discrete key frame animation without streaming interpolation, 142–143 Loaded event trigger DoubleA nimationUsingKeyFrames overview of, 137 element, 141–144 starting an animation with, 138 overview of, 140 KeyUp event handler, 126, 129 M Mac OSs L keyboard shortcuts and, 117 Language Integrated Query (LINQ), 214 prerequisites for GPU acceleration, 253 Languages, multiple language support, 118 Silverlight cross platform support, 5 Layout video memory managers, 264 algorithm for, 174 MarkerReached event handler, 189–190 application layout, 38–39 Markers, connecting video markers to automatic sizing and positioning, 154–157 application display, 189–190 Border element, 159–160 Mask property, applied to image brush, building custom, 169–173 243–244 Canvas element, 158–159 MaxFrameRate, draw loop process and, 82 changing element size, 151 MaxWidth and MaxHeight properties, Grid elements, 158 element, 167 events, 173–174 MeasureOverride method, WrapPanel Grid element, 162–167 class, 170, 173 overview of, 153 Media performance tips for, 176 adding controls to media players, 183–187 principles, 153–154 connecting video markers to application readability of text and, 99 display, 189–190 review, 176 content delivery, 178–179 rounding, 167–169 creating media players, 180 scale independence, 157 elements, 180 Silverlight 3 features, 8 full screen capability, 179–180, 188–189 StackPanel element, 161 integrating with other application steps in, 175 content, 178 TextBlock element, 100–103 media players, 191–192 LayoutUpdated event, 173–174 overview of, 177
  8. 276 Index Media (continued) input events and, 8 playing video, 180–183 process of, 128 principles, 178 receiving Web browser events, 116 review, 193 starting animation in response to mouse sources, 190–191 event, 138–139 video and audio capabilities in MouseEnter events, 122–123 Silverlight, 8–9 MouseLeave events, 122–123 video effects and transitions, 187–188 MouseLeftButtonDown event handler, writing media applications, 4–5 120–122 Media players MouseLeftButtonUp event handler, 120–122 adding controls to, 183–187 MouseMove events, 122–123 adding full screen capability to video MouseWheel event handler, 119 player, 188–189 MP3 audio format, 9 creating, 180 MPEG audio format steps in operation of, 191–192 media delivery and, 178–179 MediaElement media source and, 182 applying effect directly to, 249 Multi-core rendering, graphics, 94–95 delegating control actions to event Multiple monitors, GPU acceleration handlers, 184 and, 265 displaying contents of, 180 playing video with, 180–181 Position property, 187 N Namespace, XAML, 23–24 Memory .NET CLR. See CLR (Common Language allocation, 264 Runtime) CPU vs. GPU access, 264 Networking diagnosing performance problems, 259 retrieving data for client-side video memory, 254 applications, 13 Menus, sliding menu of controls, 131 Silverlight 3 features, 9 Microsoft NonZero rule, fill rules, 59–61 LINQ (Language Integrated Query), 214 NotifyOnValidationError, 227–228 Windows (OSs). See Windows OSs Novell Moonlight project, 5–6 Word, 107 MinWidth and MinHeight properties, Grid element, 167 O Mip-maps Objects effect surface generation and, 248 Binding object, 215–217, 220, 229–230 scaling and, 92 constructing application objects with Mode property, Binding object and, 220 XAML, 18–20, 22–23 Moonlight project, Novell, 5–6 DateTime object, 137 Motion blur, reducing jumpy quality of incremental redraw, 92–94 animation with, 134 keyframe animations between, 143–144 Mouse Occlusion culling, graphics, 94 asynchronous firing of events, 129 Opacity capture, 119–124 changing element opacity, 150–151 cross-platform consistency, 117 overview of, 79 delegation to appropriate element, 117 Opacity property event bubbling, 124–125 exceptions to visibility rule in event handlers, 120 hit-testing, 126 hit-testing, 125–126 passing to pixel shader, 245–246
  9. Index 277 OpacityMask property, 79–81 linear interpolation based on From and OpenGL2.x, 253, 263 To values, 140–141 Orientation property, StackPanel Position property, MediaElement, 187 element, 161 Positioning elements, layout, 155 OSs (operating system) Prerequisites, for GPU acceleration, 253 cross platform support, 5–6, 13 Principles Mac OSs. See Mac OSs animation, 132 multiple languages support, 118 application, 11 Windows (OSs). See Windows OSs control, 196 data binding, 213–214 effect, 233 P GPU acceleration, 251–252 Padding property, 160 graphic, 41 Panel class, WrapPanel derived from, 170 input event, 115–116 Parser, XAML, 35 layout, 153–154 Path element media, 178 extending Shape element, 55–57 Silverlight, 2–3 mini-language commands, 57 text, 98 Pause operation, media players, 184 Progress indicator, playing video and, 181 Performance Progressive download animation and, 136 Silverlight supporting, 177, 179 BlurEffect and DropShadowEffect sources for, 190–191 and, 250 Projections, 3D transforms, 75 diagnosing performance problems, 259–263 Property callback method, 245 GPU acceleration and, 189, 252 Property change speed isolating slowest changing properties in changing quickly for animation animation, 149 performance, 136 layout and, 176 changing values over time for smooth Web browsers and, 34 animation, 134–135 XAPs (deployment packages) benefits, 31 setting for animation, 149–151 Pixel shader. See HLSL (High Level Shader Language) pixel shader Pixels Q converting geometry to, 83 Quality, balancing image quality and GPU capable of higher fill rates than speed, 47–48 CPUs, 252 Query languages, 214 uniform scaling and, 99 Plug-in, Silverlight EnableCacheVisualizaion flag on, 260 R EnableFrameRateCounter flag on, 260 Radial gradient brushes, 66–67 EnableGPUA cceleration flag on, 253–254 RadiusX and RadiusY properties, for hosting with windowless=false, 121 rounding corners of rectangles, 50 as primary entry point for Silverlight, 33–34 Rasterization, 83–88 releasing/calling focus, 116 anti-aliasing and, 85–86 setting focus, 127 artifacts of anti-aliasing, 87–88 PNG image format, 62 effect surface generation and, 248 Point sizes, fonts, 107 occlusion culling and, 94 Point, type conversion, 25–26 readability of text and, 99, 112–113 PointA nimation element sampling and, 83–85 BeginTime property, 144 Readability, rendering text for, 99
  10. 278 Index Real-time speed, effects, 233–234 shapes, 150 Rectangles text, 98–99 automatic sizing and positioning, 174 transforms for, 73 changing to ellipse, 143–144 Screen drawing, 48–50 animation, 151 Red, green, blue (RGB) color, 64 getting graphic content to, 95 Redrawing objects, incremental scRGB colors, 64 redraw, 92–94 SDK (Software Development Kit) RenderA tScale property, 257–259 DateTime object, 137 Rendering using Visual Studio with, 5 applications, 39 Security cross platform consistency, 47 applications, 14 multi-core rendering, 94–95 Silverlight, 3–4 text for readability, 99 SetBinding property, RenderTransform, Canvases, 73 FrameworkElement, 229 RepeatBehavior property, managing Setter elements, setting styles with, 207 animations on timeline, 144 Shapes Resources, performance tips for, 34 changing position of (animation), 150 Retained mode graphics API ellipses, 50–51 compared with immediate mode, 45 Figure element, 58 options for constructing, 46–47 fill rules, 58–61 overview of, 43 lines, 51–55 removing rectangle with, 44 path element, 55–58 RGB (red, green, blue) color, 64 rectangles, 48–50 RIAs (rich Internet applications), 4–5 rotating or scaling, 150 Rich Internet applications (RIAs), 4–5 Shape element, 48 RotateTransform, 73 transforms for, 73 Rotation Silverlight overview, 1–10 shapes, 150 cross platform support, 5–6 transforms for, 73 ease of development, 5 Rounding layout sizes, to resolve seaming introduction to, 1–2 problems, 167–169 media and rich Internet applications, 4–5 RowDefinition properties, Grid element, principles, 2–3 164–165 review, 10 Runtime architecture, applications, 32–33 security, 3–4 RuntimeVersion property, Silverlight Silverlight 3 features, 6–9 versions, 17 Web deployment, 3 SIMD (Single Instruction Multiple Data), 234 S SizeChanged event, layout events, 173–174 Sampling Sizing elements converting geometry to pixels, 83–85 automatic application resize, 156–157 converting time-based animation into changing element or text size, 151 frames, 134 layout, 154–155 Scalable vector graphics (SVG), 4 Skews, transforms for, 73 ScaleTransform, 73 Software Development Kit (SDK) Scaling DateTime object, 137 bilinear filtering and, 91–92 using Visual Studio with, 5 mip-mapping and, 92 Solid color brush, 63–64 scale independent layout, 157 source parameter, XAP package, 16
  11. Index 279 Source property Templates images, 62 ContentControl element, 199–201 MediaElement, 182, 190–191 control templates, 210 Silverlight plug-in, 33 ItemsControl element, 202 Sources, for data binding, 214 Tex2D function, HLSL pixel shader, 240 Speed, balancing image quality with, 47–48 Text SpreadMethod property, Gradient animation of, 107, 150 brushes, 68 caching and, 112 sRGB colors, 64 changing size, 151 Stability, GPU acceleration and, 252–253 cross-platform consistency, 98 StackPanel element elements, 99–100 arranging elements in horizontal or vertical exceptions to visibility rule in stacks, 161 hit-testing, 126 positioning elements, 155 font download, 111–112 resolving seaming problems due to non- font enumeration, 110–111 integer positioning, 168–169 font fallback list, 111 text layout and, 103 fonts, 106–107 Startup event handler, 18 formatting, 103–105 Stop operation, media players, 184 Glyphs element, 107–110 Stop( ), Storyboard element, 144 layout, 100–103 Storage services, storing local state with, 13 layout sizing and, 156 Storyboard element overview of, 97–98 BeginTime property, 144 principles, 98 list of animations to run, 137 rasterization and, 112–113 Stop( ) method, 144 rendering for readability, 99 Streaming media review, 113 Silverlight 3 media features, 177 scale independent layout, 98–99, 157 sources for, 190–191 Silverlight 3 features, 7–8 String, type conversion, 25–26 subpixel positioning of text Strokes characters, 99 adding dashes, 71–72 TextA lignment property, text layout, 103 changing display of, 150 TextBlock element drawing lines, 51 Border element and, 159–160 drawing rectangles, 49 centering within grid cell, 166 drawing shapes, 48 displaying paragraph of text with, 100 overview of, 69 enumerating font files/families, 110–111 solid color brushes, 63 font download, 111–112 widening process, 70–71 font fallback list, 111 Style element, controls, 206–207 fonts, 106–107 Subpixel positioning, text characters, 99 formatting text, 103–105 Surface generation, effects, 248 layout of text, 100–103 SVG (scalable vector graphics), 4 overview of, 97 Synchronization. See Data synchronization Style element, 207 uniform scaling, 98–99 T TextBox element Tab operations, setting focus via, 127 font fallback list, 111 Template property mapping several keys to single key, 129 ContentControl element, 199–201 multiple language support, 118 ItemsControl element, 202 text editing with, 97
  12. 280 Index TextDecorations property, TextBlock VC1 decoder, 9, 178 element, 104–105 Vector graphics TextWrapping property, TextBlock compared with bitmap images, 41–42 element, 100–101 scaling, 42–43 Time-based animation, vs. frame-based, Versions, RuntimeVersion property, 17 132–134 VerticalA lignment property, Grid Time formats, 137 element, 166 Timelines, animation and, 145 Video Timers adding full screen capability to video setting up in animation, 148 player, 188–189 window.setInterval, 134–135 decoders, 5–6 Toolkit, controls in, 197 delivering full screen experience, 179–180 Transforms effects and transitions, 187–188 3D transforms, 75–77 memory allocation, 264 animating brush transform, 150 playing video, 180–183 overview of, 73–75 Silverlight capabilities, 8–9 Transitions, video, 187–188 Video markers, connecting to application TranslateTransform, 73 display, 189–190 Transparent backgrounds Video memory causing slowdown of animation, 151 diagnosing performance problems, 259 windowless=true and, 96 GPU access to, 254, 264 Triangles, stroke widening process Video memory managers, 264 applied to, 71 VideoBrush Triggers collection, Canvas element, 137 compared with ImageBrush, 191 Triggers, responding to events, 137 displaying MediaElement contents, 180 TrueType, 112 effects and transitions, 187–188 Type converters, XAML, 24–26 Visual Basic, 2, 5 Visual Studio U creating Silverlight applications UI (user interface) with, 14–15 animation and, 131 Silverlight development and, 5 defining UI controls, 183–184 tools for creating Silverlight content, 1 using UI controls, 13 writing application code, 13 UIElement VisualStateManager CacheMode property, 254–259 customizing built-in controls, 203–206 Effect property, 234, 238 GoToState method of, 207–211 OpacityMask property, 79 overview of, 195 Underlining text, 104 URI, referencing components in W XAPs, 30–31 Web browsers User interface. See UI (user interface) cross platform support, 13 UserControl element delivering full screen experience, 179–180 building control derived from, 195 downloading through, 35 control instantiation and, 209–210 graphics and media limitations of, 4–5 keyboard events and, 129 V mouse events and, 128 ValidateOnExceptions flag, 227–228 performance tips for, 34 Value converters, data binding and, 225–227 receiving Web browser events, 116–117
  13. Index 281 Web browsers (continued) Wrapping text, 100–101 taking applications out of browser, 12, 20–21 WYSIWYG tools, editing XAML with, 18 text and, 98 Web deployment hosting applications on Web pages, 12 X XAML of Silverlight applications, 3 adding status field and name to Web pages controls, 185–186 deploying applications from, 14 connecting data sources to elements, hosting applications on, 12 216–217 improving loading times, 34 connecting event handlers to input Web sites, designer/developer collaboration events, 118–119 and, 13 constructing application objects, 22–23 Width property constructing application objects with, 18–20 automatic sizing and positioning of custom classes, 27–29 elements, 174 customizing controls, 198 Grid element, 165 data binding and, 214–215 ImageElement, 62 defining element content, 29–30 MediaElement, 181 defining UI controls, 183–184 TextBlock element, 100–101 event handlers, 26–27 windowless=false exporters, 47 hosting Silverlight plug-in with, 121 for graphics and layout, 13 receiving Web browser events and, 116 namespace, 23–24 for smooth animation, 151 type converters, 24–26 windowless=true visual display of Silverlight receiving Web browser events and, 116 application as, 5 transparent backgrounds and, 96 XAPs (deployment packages) and, 7, 30 Windows Media Audio. See WMA (Windows XAML parser, 35 Media Audio) XAPs (deployment packages) Windows Media Server, 191 application deployment and, 12 Windows Media Video. See WMV (Windows application structure and, 20 Media Video) downloader, 34–35 Windows OSs packing XAML files, data files, and GDI (Graphics Device Interface), 99 manifests as, 30–31 keyboard shortcuts and, 117 performance benefits of, 31 prerequisites for GPU acceleration, 253 placing fonts in, 112 Silverlight cross platform support, 5 in Silverlight application model, 7 video memory managers, 264 XML windows, resizing, 156 data sources, 214 window.setInterval, changing property declarative. See XAML values over time, 134–135 XPS printer driver WMA (Windows Media Audio) exporter for XAML files, 47 media delivery and, 179 support for Glyphs element, 107 media source and, 182 Silverlight 3 audio formats, 9 WMV (Windows Media Video) Z Silverlight 3 video formats, 177 ZIP files, 20. See also XAPs (deployment with VC1 decoder, 178 packages) Word, Microsoft, 107 Zoom, creating images in deep zoom WrapPanel class, 169–173 format, 7
  14. This page intentionally left blank
  15. THIS PRODUCT informit.com/register Register the Addison-Wesley, Exam Registering your products can unlock Cram, Prentice Hall, Que, and the following benefits: Sams products you own to unlock • Access to supplemental content, great benefits. including bonus chapters, source code, or project files. To begin the registration process, • A coupon to be used on your simply go to informit.com/register next purchase. to sign in or create an account. You will then be prompted to enter Registration benefits vary by product. the 10- or 13-digit ISBN that appears Benefits will be listed on your Account on the back cover of your product. page under Registered Products. About InformIT — THE TRUSTED TECHNOLOGY LEARNING SOURCE INFORMIT IS HOME TO THE LEADING TECHNOLOGY PUBLISHING IMPRINTS Addison-Wesley Professional, Cisco Press, Exam Cram, IBM Press, Prentice Hall Professional, Que, and Sams. Here you will gain access to quality and trusted content and resources from the authors, creators, innovators, and leaders of technology. Whether you’re looking for a book on a new technology, a helpful article, timely newsletters, or access to the Safari Books Online digital library, InformIT has a solution for you. informIT.com THE TRUSTED TECHNOLOGY LEARNING SOURCE Addison-Wesley | Cisco Press | Exam Cram IBM Press | Que | Prentice Hall | Sams SAFARI BOOKS ONLINE
  16. Microsoft .NET Development Series 978-0-321-15489-7 978-0-321-19445-9 978-0-321-37447-9 978-0-321-38218-4 978-0-321-51444-8 978-0-321-33488-6 978-0-321-41175-4 978-0-321-39820-8 978-0-321-27872-2 978-0-321-56299-9 978-0-321-41834-0 978-0-321-35017-6 978-0-321-19769-6 978-0-321-23770-5 978-0-321-44006-8 978-0-321-34138-9 978-0-321-41850-0
  17. For more information go to informit.com/msdotnetseries/ 978-0-201-73411-9 978-0-321-22835-2 978-0-321-54561-9 978-0-321-43482-1 978-0-321-33421-3 978-0-321-53392-0 978-0-321-15493-4 978-0-321-24673-8 978-0-321-26892-1 978-0-321-41059-7 978-0-321-30363-9 978-0-321-26796-2 978-0-321-39983-0 978-0-321-16951-8 978-0-321-17403-1 978-0-321-17404-8
  18. informIT.com THE TRUSTED TECHNOLOGY LEARNING SOURCE InformIT is a brand of Pearson and the online presence for the world’s leading technology publishers. It’s your source for reliable and qualified content and knowledge, providing access to the top brands, authors, and contributors from the tech community. LearnIT at InformIT Looking for a book, eBook, or training video on a new technology? Seek- ing timely and relevant information and tutorials? Looking for expert opin- ions, advice, and tips? InformIT has the solution. • Learn about new releases and special promotions by subscribing to a wide variety of newsletters. Visit informit.com /newsletters. • Access FREE podcasts from experts at informit.com /podcasts. • Read the latest author articles and sample chapters at informit.com /articles. • Access thousands of books and videos in the Safari Books Online digital library at safari.informit.com. • Get tips from expert blogs at informit.com /blogs. Visit informit.com /learn to discover all the ways you can access the hottest technology content. Are You Part of the IT Crowd? Connect with Pearson authors and editors via RSS feeds, Facebook, Twitter, YouTube, and more! Visit informit.com /socialconnect. informIT.com THE TRUSTED TECHNOLOGY LEARNING SOURCE
  19. Try Safari Books Online FREE Get online access to 5,000+ Books and Videos FREE TRIAL—GET STARTED TODAY! www.informit.com/safaritrial Find trusted answers, fast Only Safari lets you search across thousands of best-selling books from the top technology publishers, including Addison-Wesley Professional, Cisco Press, O’Reilly, Prentice Hall, Que, and Sams. Master the latest tools and techniques In addition to gaining access to an incredible inventory of technical books, Safari’s extensive collection of video tutorials lets you learn from the leading video training experts. WAIT, THERE’S MORE! Keep your competitive edge With Rough Cuts, get access to the developing manuscript and be among the first to learn the newest technologies. Stay current with emerging technologies Short Cuts and Quick Reference Sheets are short, concise, focused content created to get you up-to-speed quickly on new and cutting-edge technologies.
  20. FREE Online Edition Your purchase of Essential Silverlight 3 includes access to a free online edition for 45 days through the Safari Books Online subscription service. Nearly every Addison-Wesley Professional book is available online through Safari Books Online, along with more than 5,000 other technical books and videos from publishers such as Cisco Press, Exam Cram, IBM Press, O’Reilly, Prentice Hall, Que, and Sams. SAFARI BOOKS ONLINE allows you to search for a specific answer, cut and paste code, download chapters, and stay current with emerging technologies. Activate your FREE Online Edition at www.informit.com/safarifree STEP 1: Enter the coupon code: NPIEQGA. STEP 2: New Safari users, complete the brief registration form. Safari subscribers, just log in. If you have difficulty registering on Safari or accessing the online edition, please e-mail customer-service@safaribooksonline.com
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2