1041
■ ■ ■
■ AAccelerationRatio property, 404–405AcceptsReturn, 179Activated event, 120ActiveX control, 976ActiveX interoperability, 976ActualHeight property, 63ActualWidth property, 63, 398, 399AddBackEntry() method, 758, 759AddBackReference() method, 761, 763AddDirtyRect() method, 390AddedItems property, 186AddFixedDocument() method, 920AddHandler() method, 106, 108, 114Adding Resources, 213–214Add-ins, 997
AddInToken.Activate<T> method, 1009, 1010advantages and disadvantages, 998class definition, view and host, 1013discovery, 1009FindAddIn() method, 1009host interaction
automation, 1012ReportProgress() method, 1012
information details, 1009Initialize() method, 1013–1016interfaces, 997lifetime, 1011MAF and MEF, 997–998pipeline, 998
adapters, 999, 1006–1007AddInStore.Rebuild() method, 1009AddInStore.Update() method, 1009
class relationships, 999communication, 999contract, 999, 1004–1005directory structure, 1001host adapter, 1008host view, 1007, 1008MustInherit abstract class, 1005–1006solution preparation, 1002–1003views, 999
to process images, 1011reflection, 997view, 1005visual add-ins
FrameworkElementAdapters, 1018GetVisual() method, 1019IImageProcessorContract, 1017user interface element, 1017
AddLogicalChild() method, 372AddVisualChild() method, 372AddVisual() method, 373ADO.NET DataView, 656ADO.NET objects, 572–574AdornedElementPlaceholder, 590–591AdornerDecorator, 469Adorner layer, 589Airspace rule, 971–973Aligning Content, 156AllowDrop property, 131AllowsTransparency property, 168, 776all-purpose Undo() method, 265AlternationCount property, 614AlternationIndex property, 620–621AmbientLight, 846AnchorChanged event, 931
Index
■ INDEX
1042
Anchor property, 930Anchors collection, 930Anchors property, 928Animation, 431
bitmap caching, 428–430brushes
ColorAnimation, 438ellipse, 438Gradient Obsession, 439hypnotic effects, 439PointAnimation, 438RadialGradientBrush, 437VisualBrush, 439–440
challenges, 431classes
cluttered namespace, 395ColorAnimation, 393complete list, 394–395data type, 393DoubleAnimation, 393, 395interpolation animation class, 394key-frame animation, 394linear interpolation, 394path-based animation, 394System.Windows.Media.Animation
namespace, 394TypeNameAnimation, 393TypeNameAnimationUsingPath, 394
code-basedanimated button, 397BeginAnimation() method, 396Duration property, 401By property, 400From property, 398–399To property, 399–400standard frame rate, 396storyboard, 396
discrete key-frames, 443–444dynamic user interfaces, 391easing function
classes, 420–422custom, 423–425EasingFunctionBase class, 418EasingFunction property, 418, 419Easing In, 419–420Easing Out, 419–420ElasticEase class, 418growStoryboard animation, 418linear interpolation, 418Oscillations property, 418Springiness, 418
easing key frames, 444frame-based
Canvas.SetTop() method, 450CompositionTarget.Rendering event, 449EllipseInfo object, 449falling circles, 449rendering event handler, 448techniques, 448TimeTracker class, 451
frame rate, 425–427guidelines, 431key-frame animation, 442–443lifetime, 401–402multiple transforms, 435–437path-based, 446–448pixel shaders, 440–442property-based, 392–393reference types, 393simultaneous, 401spline key frame, 444–445storyboards (see Storyboards)estoryboards in code (see Bomb-dropping game)eTimeline class
AccelerationRatio property, 404–405AnimationTimeline, 403DecelerationRatio property, 404–405MediaTimeline, 403properties, 404RepeatBehavior property, 405–406TimelineGroup, 403
timer-based, 391–392transforms, 432
definition, 432LayoutTransform, 432, 434RenderTransform, 432RotateTransform, 432ScaleTransform, 432
vs. traditional media files, 391AnimationTimeline class, 403AnnotationHelper class, 923, 924, 930AnnotationHelper.GetAnchorInfo() method, 930AnnotationResource objects, 930Annotations
classes, 922–923creation, 924–928customizing sticky notes, 932û933DocumentViewer, 922enabling annotation service, 923û924examination
AnchorChanged event, 931
1043
■ INDEX
AnnotationHelper.GetAnchorInfo() method,930
AnnotationStore.GetAnnotations() method, 930
AuthorChanged event, 931CargoChanged event, 931Cargos property, 928–929ContentLocator object, 928GetAnchorInfo() method, 930GetAnnotations() method, 928IAnchorInfo, 930properties, 928Section object, 929–930StoreContentChanged event, 931TextAnchor objects, 930
FlowDocumentPageViewer, 922FlowDocumentReader, 922FlowDocumentScrollViewer, 922highlighting, 921sticky notes, 921storing, fixed document, 931–932
AnnotationService class, 922, 924AnnotationService.Enable() method, 923, 924AnnotationService object, 923AnnotationStore class, 922AnnotationStore.GetAnnotations() method, 930AnnotationStream object, 923, 931AnnotationType property, 928AnnotionService.GetService() method, 924Anti-aliasing, 324AppendAudio() method, 832AppendBreak() method, 832AppendText() method, 832AppendTextWithHint() method, 832AppendTextWithPronounciation() method, 832Application class, 747ApplicationCommands.Print command, 920, 927ApplicationCommands.Undo command, 516–517Application.DispatcherUnhandledException event,
747Application.EnableVisualStyles() method, 970ApplicationExtension, 768Application.MainWindow property, 196ApplicationName.exe, 769ApplicationName.exe.manifest, 769ApplicationName.xbap, 769Application.NavigationFailed event, 747Application resources, 275–276Application.Run() method, 196, 199ApplicationsCommands.Open command, 791Application.Shutdown() method, 198
Application.ShutdownMode, 198Application.Startup event fires, 207Application.StartupUri property, 203, 752Application style, 527Application.Windows collection, 204ApplyPropertyValue() method, 917Arcs, 356–358Arrange() method, 543ArrangeOverride() method, 543–544, 547Assembly resources, 269
AssemblyName.g.resources, 214binary resources, 212content files, 217–218embedded resource, 213ImageLibrary, 217.NET applications, 212.NET Reflector, 214pack URI syntax, 216resource-aware classes, 215–216retrieving, 214–215strong-named assembly, 217
Asset Library, 303asynchronous data bindings, 597–598Asynchronous navigation, 756AsyncOperation class, 992AsyncOperationManager class, 992Attached events, 114Audio, speech
MediaPlayer class, 816–818playing WAV audio
SoundPlayerAction class, 815SoundPlayer class, 813–815system sounds, 816
speechrecognition. (see Speech recognition)esynthesis (see Speech synthesis)e
and video (see MediaElement class)eAuthorChanged event, 931Authors property, 928Automatic columns, 910AutoReverse property, 402, 404, 405AutoWordSelection, 180AuxiliaryPaneContentTemplate, 802Axis lines, 849
■ BBackColor property, 980BackContent property, 529BackEase class, 420Background property, 529, 744, 776, 887, 899
■ INDEX
1044
BackgroundWorkerasynchronous operation, 987–988cancellation
BackgroundWorker.CancelAsync() method, 993
BackgroundWorker.WorkerSupportsCancellation property, 993
CancelAsync() method, 994DoWorkEventArgs.Cancel property, 994FindPrimes() method, 994RunWorkerCompleted event, 994–995
cancel messages, 987creation, 989progress events, 997running
BackgroundWorker.RunWorkerAsync() method, 990
Dispatcher.BeginInvoke() method, 992DispatcherSynchronizationContext object,
992DoWork event, 991FindPrimesInput object, 990–991multithreading classes, 992prime-number search, 990RunWorkerCompleted event, 991RunWorkerCompletedEventArgs.Result
property, 991WindowsFormsSynchronizationContext
object, 992Worker.FindPrimes() method, 991
System.ComponentModel.BackgroundWorker component, 987
System.Threading.Thread object, 987Thread.Start() method, 987tracking progress, 992–993
BackgroundWorker.CancelAsync() method, 993BackgroundWorker.ReportProgress() method, 992BackgroundWorker.WorkerReportsProgress
property, 992BackgroundWorker.WorkerSupportsCancellation
property, 993BackStack property, 759BandIndex property, 796Bare-bones flow document, 890BasedOn attribute, 291BasedOn property, 287, 291BeginAnimation() method, 396, 401, 402BeginChange() method, 181BeginInit() method, 119BeginStoryboard action, 297, 407, 820, 825BeginStoryboard.HandoffBehavior property, 409
BeginStyle() method, 832BeginTime property, 404, 411Behaviors, 283
assemblies, 298code-free application design, 299creation
Behavior class, 300Canvas coordinates, 300DragInCanvasBehavior code, 300–301element reposition, 302event handlers, 301FrameworkElement, 300mouse button release, 302OnAttached() method, 300OnDetaching() method, 300UIElement, 300watermark text, 300
CustomBehaviorsLibrary, 302custom controls, 298design-time behavior, 303design-time feature, 298draggable elements, 303DragInCanvasBehavior class, 302Ellipse elements, 302Expression Blend, 298feature version, 299guidelines, 299Interaction.Behaviors attached property, 302Microsoft.Expression.Interactions.dll assembly,
299Rectangle element, 302System.Windows.Interactivity.dll assembly, 299,
302triggers, 299user-interface functionality, 298Visual Studio application, 298
BetweenShowDelay window, 167Bevel line join, 321Bézier curves, 358–359Binary Application Markup Language (BAML), 752BindingDirection, 974Binding.ElementName property, 238Binding elements
Binding.ElementName property, 238code creation, 232–233code retrieving, 233delay property, 238element-to-element binding, 227errors, 229expression, 228–229linked controls, 228
1045
■ INDEX
modesdefault, 231–232OneWayToSource, 231slider thumb, 229System.Windows.Data.BindingMode
enumeration, 230multiple binding, 234–236object
DataContext, 241RelativeSource, 239–240source, 239
updates, 237–238Binding errors, 229Binding expression, 228–229BindingExpression.UpdateSource() method, 238BindingGroup property, 592Binding.IsAsync property, 598BindingListCollectionView, 647, 648, 657, 658, 663Binding.NotifyOnValidationError property, 587BindingOperations.GetBinding() method, 233Binding.RelativeSource property, 515, 619Binding.StringFormat property, 603, 614Binding.XPath property, 600BitmapCacheBrush.BitmapCache property, 336BitmapCacheBrush class, 325, 336–337BitmapEffect class, 380–381BitmapImage.BeginInit() method, 608BitmapImage object, 216, 605Blender, 856Block elements, 886
BlockUIContainer, 895–896List, 891–892Paragraph and Run, 890Section, 894–895Table, 892–894
Block.NextBlock property, 903BlockUIContainer class, 916BlockUIContainer element, 895, 899BlurEffect, 381, 540Bold element, 896Bomb-dropping game
animationsdrops the bomb, 452falling vs. rescued bomb, 460
DispatcherTimer, 455–458IsFalling property, 458–460main window
Border element, 453game statistics, 453
refinements, 461rotates the bomb, 452
save and update, 453, 460user control, 454–455
Boolean property, 529Boolean SuppressExceptions property, 610BorderBrush property, 64, 146, 887, 894, 899BorderThickness property, 64, 146, 887, 894, 899Bottom property, 82BounceEase class, 420Bound object, 562–564Box value, 891Brushes
BitmapCacheBrush, 336–337change notification, 325classes, 325Freezable, 325ImageBrush, 331–332, 342LinearGradientBrush, 326–328partial transparency, 325RadialGradientBrush, 329–330SolidColorBrush, 325–326, 342TileBrush, 342tiled ImageBrush, 332–335VisualBrush, 335–336
Building Localizable User Interfaces, 218–219Built-in element, 133ButtonBase, 797ButtonChrome class, 469, 550ButtonChrome decorator, 65, 146ButtonChrome.RenderMouseOver property, 550Button.FontFamily, 289ButtonState event, 129Button.Style property, 409, 793By property, 400
■ CCache length, 578–579CacheLengthUnit property, 578CacheMode property, 429Calendar class, 192CalendarClosed event, 193CalendarOpened event, 193call RenderOpen() method, 371CanAddToQuickAccessToolbarDirectly property,
810CanContentScroll, 172CanExecute event, 516, 517CanExecute() method, 245, 246CanExecuteSave() method, 261CanGoBack property, 756, 758, 781CanGoForward property, 756, 781
■ INDEX
1046
CanUndo property, 181Canvas, 313
animatable content, 398Bottom property, 82ClipToBounds property, 83code example with four buttons, 83Height property, 83InkCanvas, 84
annotating content with user-drawn strokes, 84
EditingMode property, enumeration values, 85
Stroke objects, 84Strokes collection, 84
Left property, 82lightweight features of, 83nesting inside a user interface, 83placing elements using exact coordinates, 82Right property, 82Top property, 82Width property, 83ZIndex property, 84
Canvas.ClipToBounds property, 316, 426CargoChanged event, 931Cargos property, 928CategoryName property, 632, 633Category.Products property, 571CellSpacing property, 894Center property, 329CenterX property, 339CenterY property, 339ChangeVisualState() method, 530, 537–538CheckAccess() method, 985CheckBox elements, 160–161, 617, 618, 620, 753CheckBox.IsChecked property, 113CheckedListBox class, 185children tag, 782Chrome classes, 549CircleEase class, 421Circle value, 891Class bindings, 258ClearHighlightsForSelection() method, 924ClickCount event, 129Click event, 114ClickOnce cache, 770, 771ClickOnce deployment model, 1021
additional optionsfile associations, 1037publish options, 1039Publish Version, 1035update option, 1036
advantages, 1022installation, 1023, 1033limitations, 1022, 1024partial-trust programming, 1022publication
CD or DVD, 1030directory structure, 1032installation type, 1028network file share, 1028online/offline application, 1031project settings, 1024publisher and production settings, 1025Publish Wizard, 1027web server, 1029
shortcuts, 1027strategies, 1021updates, 1034
Clip art, 367–368Clipboard group, 803ClipGeometry class, 364Clipping property, 828ClipToBounds property, 83Clock.CurrentProgress property, 417Close() method, 817Closing event, 120CodeAccessPermission.Demand() method, 773CodeAccessPermission objects, 773Code access security, 771Code-based approach, 653Coercion Callback, 102–104Collection items
displaying and editingdata template supply, 570DisplayMemberPath property, 570Grid.DataContent property, 570IsLocked property, 571ListBox.SelectedItem property, 571list of products, 568master-details display, 571SelectionChanged event, 570StoreDB.GetProducts() method, 568–569ToString() method, 569, 570unhelpful bound list, 570UpdateProducts() method, 571
inserting and removing, 572CollectionViewSource class, 651–653CollectionViewSource.View property, 652ColorAnimation class, 393, 395Color.FromArgb() method, 145ColorPicker class, 520ColorPicker.Color property, 525
1047
■ INDEX
ColorPicker control class, 526Color property, 509–512ColumnDefinition element, 70ColumnDefinition.MaxWidth property, 884ColumnGap property, 910Column property, 71ColumnRuleBrush property, 910ColumnRuleWidth property, 910ColumnSpan property, 894ColumnWidth property, 910ComboBox, 566, 642–645, 651ComboBox class, 576ComboBox control, 643, 645ComboBox.IsTextSearchEnabled property, 643ComboBoxItem object, 187, 614, 643Command-Line Arguments, 202–204CommandManager.InvalidateRequerySuggested()
method, 260CommandParameter property, 790, 926Command property, 790Commands, 243
ApplicationCommands class, 248–249application task, 245binding
ExecutedRoutedEventArgs object, 251links, 244markup, 251New command, code, 250NewCommand_Executed event handler, 251UIElement class, 250
built-in commands, 257–258CanExecuteSave() method, 261CommandBindings collection, 261ComponentCommands, 248custom commands, 259–260custom controls, 254Cut, Copy, and Paste commands, 261disabling, 255–256EditingCommands, 248Execute() method, 254features, 243fine-tuning command text, 253–254ICommand interface, 245–246isDirty flag, 261limits, 256–257mapping events, 244MediaCommands, 248menu item, 252–253NavigationCommands, 247nested element, 254parameter, 262–263
prebuilt commands, 246RoutedCommand class, 246–247RoutedUICommand class, 247scope, 260sources, 245, 249StaticResource extension, 262targets, 245TextBox.Tag, 261tool, 244tracking and reversing
all-purpose Undo() method, 265ApplicationCommands.Undo command,
263ApplicationUndo command, 267application-wide Undo action, 265–266CanExecute handler, 267CommandHistoryItem class code, 265CommandHistoryItem object, 264CommandHistoryItem, Undo() method, 267CommandManager class, 263, 266EditingCommands.Backspace command,
264MonitorCommands, 266PreviewExecuted event handler, 263–264
two-files-at-once text editor, 261undoable commands, 244without binding, 250
CommandTarget property, 790, 925Common language runtime (CLR), 12Compare() method, 658ComponentResourceKey, 279–282Composite Application Library (CAL), 998ComVisible attribute, 784ConfigureAppWizard.xaml page, 759ContainerFromElement() method, 187ContainerStyle property, 659ContainerStyleSelector property, 659ContainerUIElement3D class, 875ContainerVisual, 370ContentControl class, 152, 507, 520, 531Content controls, 505, 626
aligning content, 156buttons
ButtonBase, 159CheckBox, 159, 160–161IsCancel, 159IsDefault, 159–160RadioButton, 159, 161–162ToggleButton and RepeatButton, 160
buttons types, 153HeaderedContentControl class, 153
■ INDEX
1048
Content controls (cont.)tthierarchy, 153Label and ToolTip, 153labels, 158property, 154–155ScrollViewer (see ScrollViewer)esingle nested element, 152tooltips
fancy, 163nested element combination, 162Popup, 167–169StackPanel, 163ToolTip properties, 163–166ToolTipService Properties, 166–167user-interactive controls, 163
WPF content philosophy, 157–158ContentElement class, 396, 885Content elements
block elements (see Block elements)eevents handling, 885Focusable property, 885formatting, 887–888Hyperlink, 885, 895inline elements (see Inline elements)eParagraph elements, 886System.Windows.Documents namespace, 886vs. noncontent elements, 885
ContentPresenter element, 619ContentRendered event, 120ContentTemplate property, 155, 626ContextMenu class, 791ContextMenu property, 791ContextMenuService.ShowOnDisabled attached
property, 791Control class, 506
MouseDoubleClick event, 129PreviewMouseDoubleClick event, 129
Control.FontFamily point, 99ControllableStoryboardAction class, 411Controls
background and foreground brushessetting colors, code, 144–145setting colors, XAML, 145–146
content (see Content controls:)edate, 190–193fonts
embedding, 149–150FontFamily, 146FontStretch, 147FontStyle, 147FontWeight, 147
inheritance, 148substitution, 149text decorations and typography, 148text formatting mode, 150–151
list (see List controls)emouse cursors, 151–152range-based controls (see Range-basede
controls)System.Windows.Control class, 144text (see Text controls)euser-interactive element, 144
Control templates, 505automatic application, 490–491bare-bones styles, 502browsing, 475built-in recipe, 471BulletChrome class, 473ButtonChrome class, 471–473Button class, 471Button.xaml, 486–488creation
basic button, 478bindings, 479–481border, 478Button class, 478button control, 477ContentPresenter, 478EventTrigger-driven animation, 484–485inline template, 478properties changing, triggers, 481–483standardization and theme integration, 477StaticResource reference, 478Template property, 478
data templates, 473DrawingBrush, 474gradient button, 488LinearGradientBrush, 474ListBoxChrome class, 473live ControlTemplate object conversion, 476–
477logical tree
LogicalTreeHelper methods, 468SimpleWindow, 466System.Windows.LogicalTreeHelper, 468
MergedDictionaries collection, 486nested templates, 494–496panel template, 473Path, 474PresentationFramework.Aero.dll assembly, 473PresentationFramework.dll assembly, 475PresentationFramework.Luna.dll assembly, 473
1049
■ INDEX
PresentationFramework.Royale.dll assembly, 473
reflection, 475, 476RenderDefaulted property, 472ResizeGrip element, 474resource dictionary, 485, 486scrollbar
background, 497ContentPresenter, 500–501dissecting, 497element-typed style, 496, 499–500horizontal scrollbar, 500ListBox, 497, 501multipart structure, 498PART_Track, 499RepeatButton class, 497RepeatButton elements, 499ScrollViewer, 496three-row grid, 499thumb, 497, 500Track.ViewportSize property, 499transparent background, 501vertical scrollbar, 497–498
ScrollChrome class, 473SimpleStyles, 502SnapsToDevicePixels setting, 474StackPanel control, 465styles, 483, 488–490style trigger, 472SystemDropShadowChrome class, 473TargetName property, 472TextElement.Foreground property, 472two-button window, 465, 466user-selected skins, 491–493visual states model, 503–504visual tree, 467
GetChild() method, 468GetChildrenCount() method, 468GetParent() method, 468SimpleWindow, 467Style.TargetType property, 468System.Windows.Media.VisualTreeHelper,
468VisualTreeDisplay window, 468–470
vs. custom controls, 490XAML markup, 471XamlWriter class, 475XamlWriter.Save() method, 476XmlWriter and XmlWriterSettings objects, 476–
477ConvertBack() method, 606, 612
Convert() method, 606, 612ConvertToString() method, 124CornerRadius, 64CornerRadius pr, 530CreateHighlightCommand, 926CreateHighlightsForSelection() method, 924CreateInkStickyNoteCommand, 925, 926CreateInkStickyNoteForSelection() method, 924CreateInstanceCore() method, 423CreateTextStickyNoteForSelection() method, 924CreationTime property, 928CubicEase class, 421CubicEase function, 423CurrentGlobalSpeedInvalidated event, 416CurrentStateInvalidated event, 416CurrentTimeInvalidated event, 416CurrentUICulture property, 218CustomContentState class, 760CustomContentState object, 763Custom Control Library, 753Custom decorator, 553–554CustomDrawnDecorator, 553–554CustomDrawnElement class, 553Custom-drawn elements
composite elements, 548composition, 548creation
BackgroundColor dependency property, 552CustomDrawnElement, 551–552DrawingContext.DrawRectangle() method,
552FrameworkElement, 551FrameworkPropertyMetadata.AffectRender
flag, 552GetForegroundBrush() method, 552–553InvalidateVisual() method, 552RadialGradientBrush, 551, 552
custom decorator creation, 553–554evaluation, 550OnRender() Method, 548–549
Custom elementsbase classes, 506–508Custom Control Library project, 506custom-drawn elements (see Custom-drawne
elements)custom panels (see Custom panels)eDLL assembly, 506lookless control (see Lookless control)euser control
ColorChanged event, 516ColorConverter, 516
■ INDEX
1050
Custom elements, user control (cont.)ttColor data type, 516color picker, 509ColorPicker object, 518, 519CommandBindings collection, 518command-handling code, 518CommandManager.
RegisterClassCommandBinding() method, 518
command support, 516–517ContentPresenter, 519dependency properties, 509–512EventManager.RegisterClassHandler()
method, 518Focusable, 518HorizontalAlignment, 518InitializeComponent() method, 519IsTabStop, 518markup addition, 513–515RegisterClassCommandBinding() method,
518routed events, 512–513template-based control, 508, 509TypeConverter attribute, 516UndoCommand_CanExecute() method, 518UndoCommand_Executed() method, 518UserControl class, 519VerticalAlignment, 518XAML markup, 515XML namespace, 515
visual states (see FlipPanel)eVisual Studio solution, 506
CustomFilter property, 657Custom panels
Canvas clone, 544–545docking toolbars, 541tear-off toolbars, 541two-step layout process
ArrangeOverride() method, 543–544MeasureOverride() method, 541–543
WrapPanelArrangeOverride() method, 547FrameworkPropertyMetadata object, 545LineBreakBefore property, 545–547WrapBreakPanel, 545, 547
CustomPopupPlacementCallback, 164CustomResources class, 281Custom scrolling, 172–173custom SetContent() method, 206CustomSort property, 658
■ DDashed lines, 322–323Data access component
design, 558DLL component, 558Store database, 558–560
Data binding. See also Binding elementsocollection of objects
ADO.NET objects, 572–574collection items (see Collection items)eIEnumerable interface, 567ItemsControl class, 566, 567LINQ Expression, 574–576
database binding with custom objectsbound object display, 562–564change notification, 565–566data access component (see Data access e
component)database updation, 564–565data object, 561–562null values, 564
data providers (see Data providers)edata templates, 629long lists, performance improvement
cache length, 578–579deferred scrolling, 579item container recycling, 578Virtualization, 576–578
Redux, 601–603two-way, 557validation (see Validation, data binding)e
DataContext property, 563, 602Data conversion
conditional formatting, 610–611human-readable strings, 603multiple properties evaluation, 612–613string formatting (see String formatting)evalue converters (see Value converters)eWPF tools, 603
DataFormats class, 914DataFormats.Rtf format, 914DataFormats.Text format, 914DataFormats.XamlPackage format, 914DataFormat.Xaml format, 914Data forms, 575–576DataGrid, 566, 578, 665, 686
automatic column generation, 686column-based model, 686columns
Binding property, 690
1051
■ INDEX
DataGridCheckBoxColumn, 691DataGridComboBoxColumn, 691DataGridHyperlinkColumn, 691DataGridTemplateColumn, 693definition, 689format and style, 694frozen columns, 699Header property, 690Width property, 690wrapped text, 695
display properties, 687, 688editing, 700resizing and rearranging columns, 688–689rows
highlighting rows, 697LoadingRow event, 696row details, 698value converter, 697
selection, 700sorting, 700
DataGridView, 797Data object, 561–562Data providers
DataContext, 595definition, 595ObjectDataProvider (see ObjectDataProvider)eProductListSource class, 595resource section, 595System.Windows.Data.DataSourceProvider
class, 595XmlDataProvider, 595, 598–600
DataRow object, 573–574DataRowView object, 631Data Sources window, 576DataTable class, 575, 648, 656–657DataTable data binding, 572–574DataTable.DefaultView property, 573, 657DataTable.Rows collection, 573, 574DataTemplate.DataType property, 628Data templates, 505
advanced templates, 629–631Border object, 627content controls, 626ContentTemplate, 626DisplayMemberPath property, 625Grid objects, 627ItemsSource proprty, 626ItemTemplate property, 626list box example, 626list controls, 626ListView, 627
selectionBinding.RelativeSource property, 637changing item layout, 641expanding selected item, 638, 639Foreground and Background properties, 636highlighting selected item, 637, 638ItemContainerStyle, 639ItemContainerStyle property, 636ListBoxItem.Background property, 637RelativeSource property, 639SnapsToDevicePixels property, 638StackPanel, tigger, 640unreadable text, highlighted item, 636Visibility property, 639
selectors, 633–636separating and reusing, 628–629varying templates, 632–633XAML markup, 626
DataTemplateSelector, 633–636DataTrigger class, 294Data triggers, 611, 636, 640DataView class, 573DataView.RowFilter, 657Data views
filteringcheck boxes, 656DataTable, 656–657dedicated filtering class, 655FilterItem() method, 656FilterProduct() method, 653Filter property, 653inline filtering method, 654minimum price, 655–656MinMaxFilter, 655Refresh() method, 656removing Filter property, 656StringFilter, 655TextChanged event, 656
groupingCategoryID property, 659CategoryName property, 659CollectionView.GroupDescriptions
collection, 659GroupItem objects, 659GroupStyle.HeaderTemplate, 660GroupStyle objects, 660GroupStyle properties, 659ItemsControl.GroupStyle property, 659ListBox.GroupStyle property, 660product list, 660PropertyGroupDescription object, 660
■ INDEX
1052
Data views, grouping (cont.)ttin ranges, 661–663SortDescription, 661and virtualization, 663
live shaping, 663–664sorting, 657–658view object (see View object)e
DataView.Sort property, 658Data virtualization, 577–578Date controls, 190–193DatePicker class, 192DateValidationError event, 193Deactivated event, 120DecelerationRatio property, 427Decimal value, 891Declarative user interfaces, 18Decorator class, 507DecreaseZoom() method, 908DefaultProductStyle, 622DefaultStyleKeyProperty, 520DefaultStyleKeyProperty.OverrideMetadata()
method, 527Default transition, 535Deferred scrolling, 579DefiningGeometry property, 309DeflateStream, 776DeleteInkStickyNotesForSelection() method, 924Delete() method, 574DeleteStickyNotesCommand, 926DeleteTextStickyNotesForSelection() method, 924DeleteVisual() method, 373DependencyObject class, 511, 513, 565, 755Dependency properties, 754, 755
attached property, 99–100definition, 94.NET property system, 93property validation
CoerceValueCallback method, 101Coercion Callback, 102–104ropertyChangedCallback, 101SetValue() method, 100ValidateValueCallback, 101validation callback, 101–102
property wrapper, 96–97registering
FrameworkPropertyMetadata object, 95Register() method, 95
reusing, 99TextBlock.FontFamily, 99uses, 97–98WPF-specific creation, 94
DependencyProperty.Register() method, 95DependencyProperty.UnsetValue, 917DependencyProperty.ValidateValueCallback, 97DesiredSize property, 62, 542, 543Device-independent units, 324Device property, 121DialogResult enumeration, 969DiffuseMaterial, 859Direct events, 127DirectionalLight, 844, 845, 846Discrete key-frame animation, 443–444Disc value, 891Dispatcher.BeginInvoke() method, 985, 986Dispatcher.CurrentDispatcher property, 984DispatcherObject class, 984
BeginInvoke() method, 986, 987Dispatcher.BeginInvoke() method, 985, 986DispatcherPriority.ApplicationIdle, 986DispatcherPriority.Normal, 986DispatcherPriority.SystemIdle, 986InvalidOperationException, 985Invoke() method, 987members, 984System.Threading.Thread object, 985time-consuming code, 986UpdateTextWrong() method, 985VerifyAccess() method, 985
DispatcherOperation object, 986DispatcherPriority.ApplicationIdle, 986DispatcherPriority.SystemIdle, 986DisplayDateChanged event, 193DisplayDateStart, 192DisplayMemberPath property, 567, 573, 602, 614,
644Dispose() method, 833Dock property, 67, 976Document Object Model (DOM), 747Document property, 782Documents
fixed documents, 883flow documents (see Flow documents)e
DocumentViewer, 884docViewer, 902DoDragDrop() method, 131DoubleAnimation class, 297, 393, 395Double.NaN, 398Double.PositiveInfinity, 542DoWorkEventArgs.Argument property, 991DoWorkEventArgs.Cancel property, 994DoWorkEventArgs.Result property, 991Drag-and-drop operations, 130
1053
■ INDEX
DragDrop class, 131DragEnter event, 131DragIncrement property, 77DrawEllipse() method, 370DrawImage() method, 370DrawingBrush class, 325, 830DrawingCanvas class, 373DrawingContext class, 548DrawingContext.Close() method, 370DrawingContext.DrawGeometry() method, 549DrawingContext.DrawImage() method, 549DrawingContext methods, 370–371DrawingImage class, 331DrawingImage property, 803Drawings
classes, 364clip art, 367–368displaying
Canvas, 364classes, 364Drawing brush and image approach, 366,
367Path element, 365, 366
GeometryDrawing, 363triangle, 363
DrawingVisual object, 550DrawingVisual.RenderOpen() method, 370, 550Drawing visuals, 370–372DrawLine() method, 370DrawRectangle() method, 370DrawRoundedRectangle() method, 370DrawSelectionSquare() method, 379DrawSquare() method, 374, 376, 379DrawText() method, 370DropShadowEffect, 382–383Duration.Automatic value, 401Duration.Forever value, 401Duration property, 401, 404Dynamic property-resolution system, 393DynamicResource references, 279Dynamic resources, 271
ComponentResourceKey, 280system resources, 276, 277vs. static resource, 272–274
■ EEaseInCore() method, 423–425EaseIn mode, 419EaseInOut property, 419–420EaseIn property, 420
EaseOut property, 419–420EasingFunctionBase class, 418, 419EasingFunction property, 418, 419Easing key frames animation, 444EasingMode property, 420EditingMode property, 85ElasticEase class, 418, 420ElasticEase function, 419ElasticEase.Oscillations property, 419Electric Rain ZAM 3D, 856ElementHost class, 970, 981ElementHost control, 976–978ElementHost.EnableModelessKeyboardInterop()
method, 970ElementName property, 522Ellipse class, 308, 310Ellipse element, 533Ellipse geometry, 349EmbeddedFont.xaml, 150Embedded frame, 750Embedded Resource, 213Embedding font, 149–150EmissiveMaterial, 859, 860Enabled property, 981EnableModelessKeyboardInterop() method, 970EnableVisualStyles() method, 970, 971, 975EnableWindowsFormsInterop() method, 970EndChange() method, 181EndInit() method, 119EndLineCap property, 320EndPoint property, 327EndStyle() method, 832EndVoice() method, 832Entity data model, 575ErrorContent property, 586, 588EventArgs classes, 121EventArgs object, 402Event handlers mapping, 243EventSetter objects, 289EventTrigger class, 294Event triggers, 290, 296–298, 406
attachment with style, 408–409BeginStoryboard, 407Click event, 407data-binding expression, 408definition, 407DoubleAnimation object, 408IValueConverter, 408System.Windows.TriggerAction, 408Window.Loaded event, 407
EventTrigger.SourceName property, 413, 821
■ INDEX
1054
ExceptionRoutedEventArgs.ErrorExceptionproperty, 819
ExceptionValidationRule, 581–582, 587, 588Executed event, 516Execute() method, 245, 246, 254ExpandDirection property, 176Explorer-style file browser, 780ExponentialEase class, 421Export plug-ins, 856Expression Blend, 298, 299Expression Blend SDK, 299Expression Blend 3 SDK, 298
■ FFastSpeedProperty, 598FieldOfView property, 850Figure elements, 896, 901, 909FileMode.Read, 932FileMode.ReadWrite mode, 932FileRegistrationHelper class, 211FileRegistrationHelper registers, 211FillBehavior property, 402, 411Fill brush, 318Fill property, 309, 310FillRule property, 319FilterProduct() method, 653FindPrimes() method, 988, 992, 994FindResource() method, 527FirstDayOfWeek, 192Fixed documents, 883
annotations (see Annotations)eDocumentViewer, 884XPS files, 920, 921
Fixed frame rate, 392Fixed-sized tiles, 332Fixed-size floater, 900FlipButton, 531FlipButtonAlternate, 531FlipPanel
BackContent property, 529Control class, 528CornerRadius property, 530default control template
basic skeleton, 532ChangeVisualState() method, 537–538ContentPresenter elements, 532flip button, 533GetTemplateChild() method, 537OnApplyTemplate() method, 536–537state animations, 533–535
state transitions, 535–536ToggleButton, 537VisualStateManager.GoToState() method,
537DefaultStyleKeyProperty.OverrideMetadata()
method, 530different control template, 539–540flipping, 527, 528FrameworkElement class, 528FrontContent property, 529GetValue() and SetValue() methods, 529IsFlipped property, 529parts and states selection, 530–531structure, 528usage, 538–539
Flipping tiles, 335Floater element, 896–900, 909FlowDocument.Blocks.FirstBlock property, 902FlowDocument.Blocks.LastBlock property, 902FlowDocument.Blocks property, 902FlowDocument.ContentEnd property, 914FlowDocument.ContentStart property, 914FlowDocument element, 888FlowDocument.IsHyphenationEnabled property,
906FlowDocument.IsOptimalParagraphEnabled
property, 906FlowDocumentMaxPageWidth property, 910FlowDocument objects, 179FlowDocumentPageViewer, 884, 907–911FlowDocument properties, 910FlowDocumentReader, 884, 901, 907–908, 911, 922Flow documents
annotations (see Annotations)eColumnDefinition.MaxWidth property, 884construction, 888–890content elements (see Content elements)eediting (see RichTextBox control)eflow elements, 885–887Grid container, 884long lines, flow content, 884programmatic interaction
dynamic modification, 904free-flowing structure, 902Generate button code, 905navigation properties, 902–903single paragraph and bolded text coding,
902Span elements, 904–905Span.Tag property, 903Tag property, 903
1055
■ INDEX
read-only containersFlowDocumentPageViewer, 907FlowDocumentReader, 907FlowDocumentScrollViewer, 907loading from file, 911–912pages and columns creation, 908–911printing, 912TextBlock, 907
RichTextBox, 884support rich layout, 884text justification, 905–906wasted space, flow content, 884, 885zooming, 907–908
FlowDocumentScrollViewer, 884, 888, 890, 901, 902, 907, 908, 920, 922
FlowDocumentScrollViewer.IsSelectionEnabledproperty, 890
FlowLayoutPanel, 976Focus
control and noncontrol classes, 125definition of, 125focusable property, 125moving from one element to another, 125
Focusable property, 125, 885FontFamily attribute, 284FontFamily.BaseUri property, 150FontFamilyConverter, 284FontFamily property, 744, 887FontSize property, 744, 887FontStretch property, 887FontStyle property, 887FontWeight property, 147, 887FontWeights.Bold property, 917FontWeights.Normal property, 917FooterPaneContent template, 802ForceCursor property, 152Foreground property, 291, 744, 887FormattedText.MaxTextWidth property, 370Formatting bound data
ComboBox, 642–645data binding, 601–603data conversion (see Data conversion)edata templates (see Data templates)elist controls, 613–615list styles (see List styles)e
FormHasErrors() method, 589Form.ShowDialog() method, 969ForSelection, 924ForwardStack property, 759Fragment navigation, 748FragmentNavigation event, 757
Frame, 780Frame-based animation, 448–451Frame class, 748Frame.NavigationUIVisibility property, 749Frame objects, 750Frame.Source property, 752, 755FrameworkContentElement class, 885FrameworkElement class, 151, 162, 181, 341, 506,
531, 885FrameworkElement.Cursor property, 152FrameworkElement.FindResource() method, 275FrameworkElement.Triggers collection, 408FrameworkPropertyMetadata.Inherits flag, 148FrameworkPropertyMetadata object, 95, 510, 545Freezable class, 273From property, 398–399FrontContent property, 529
■ GGeometries
classes, 347combined geometry, 351–354curves and lines
arcs, 356–358Bézier curves, 358–359clipping, 361–362mini-language, 359–361pathfigure class, 354pathsegment class, 355straight lines, 355
ellipse, 349line, 348object, 348rectangle, 348shapes, 349–351
Geometry3D class, 839GeometryModel3D class, 839Geometry object, 309, 338GeometryTransform property, 309GetAnnotations() method, 928GetContentState() method, 762, 763GetDefaultView()method, 648getElementsByTagName() method, 784GetFileName() method, 759GetFixedDocument-Sequence() method, 920GetForegroundBrush() method, 552–553GetNavigationService() method, 755GetPosition() method, 127GetProduct() method, 561, 573, 596GetProperty() method, 544
■ INDEX
1056
GetTemplateChild() method, 525, 537GetTouchPoint() method, 134GetValue() method, 511GetVisualChild() method, 372GetVisual() method, 375GetVisuals() method, 378Global Assembly Cache (GAC), 220Glue code, 968GoBack() method, 756, 781GoForward() method, 756, 781GotFocus event, 980Gradient Obsession, 439GradientStop, 327, 328GrammarBuilder, 834GrammarBuilder.Append() method, 834Grid
ColumnDefinition and RowDefinition elements, 70
Column property, 71ColumnSpan property, 75creating a Grid-based layout, 70IsSharedSizeScope property, 81Layout Rounding, 74placing individual elements into cells, 71row and column
absolute sizes, 72automatic sizes, 72ColumnDefinition object, 73proportional sizes, 72RowDefinition object, Height property, 73using nested Grid containers, 74
Row property, 71RowSpan property, 75SharedSizeGroup property, 81shared size groups, 79Shared size property, 81ShowGridLines property, 70splitter bars, 76
Background property, 78DragIncrement property, 77guidelines, 76ResizeBehavior property, 77ResizeDirection property, 77resizing rows or columns, 76ShowsPreview property, 77
UniformGridcode example with four buttons, 82description of, 82
in Visual Studio, 72Grid.DataContent property, 570Grid wrapping, 563
GroupDescriptions property, 652GroupName property, 161GroupSizeReductionOrder property, 807GroupStyle.HeaderTemplate, 660GroupStyle property, 615GroupStyleSelector property, 615growStoryboard animation, 418GZipStream, 776
■ HHandles statement, 113HandoffBehavior.Compose, 410HandoffBehavior enumeration, 409HasContent property, 155HasDropShadow property, 164HeaderedContentControl, 169HeaderTemplate property, 659HeaderTemplateSelector property, 659HeightExplicitly property, 59Height property, 62, 901“Hidden” annotation, 925Hide() method, 745hierarchy, 271–272Higher-level tasks, 243HighlightTemplate, 633Hit testing
ContainerUIElement3D, 875in 3-D scene, 871ModelUIElement3D, 873–874in the Viewport, 872–873
HitTest() method, 377HitTestResultBehavior, 378HitTestResultCallback() method, 377HitTestResult object, 378HorizontalAlignment property, 58, 59, 156, 311, 393,
544, 899HorizontalAnchor property, 901HorizontalOffset property, 901HorizontalScrollBarVisibility property, 179Horizontal scrolling, 171HostInBrowser, 768HtmlBridge cla, 785HtmlBridge.WebClick() method, 785HTMLDocument object, 781, 782HtmlDocument object, 782hwnd, 972, 976HwndHost, 982HwndSource class, 982HwndSource property, 120Hyperlink element, 896
1057
■ INDEX
Hyperlink.NavigateUri property, 752, 755Hyperlinks
Click event, 746content element, 885, 895fragment navigation, 748inline flow elements, 745NavigateUri property, 746navigating to websites, 747Page.ShowsNavigationUI property, 746RequestNavigate event, 746TextBlock element, 745visited pages history, 746WindowTitle property, 747
■ IIAnchorInfo, 930IAnimatable interface, 396IBindingList, 647IBindingList interface, 573ICollectionView interface, 658ICollectionViewLiveShaping property, 663ICollectionView reference, 648ICollectionViewSource.Refresh() method, 663IComparer object, 658IDataErrorInfo interface, 579Id property, 928id tag, 782IEnumerable, 647IEnumerable(Of T), 575IHTMLElement.getAttribute() method, 782IHTMLElement object, 781–783ImageBrush class, 325, 331–332, 343
Stretch property, 334Viewport property, 333ViewportUnits property, 333
Image class, 549ImageDirectory property, 609ImagePathConverter class, 608–609, 610, 629ImageSource property, 281, 331, 609, 800Image.Stretch property, 900IMultiValueConverter interface, 612, 633IncreaseZoom() method, 908indowsFormsApplicationBase, 207Inertia, 139, 140InitializeComponent() method, 120, 520, 597, 756Initialized event, 119Initialized/Loaded event handler, 756InitialShowDelay property, 166, 167Inline elements, 886
Bold, 896
Figure, 896, 901Floater, 896–900Hyperlink, 896InlineUIContainer, 896Italic, 896LineBreak, 896Run, 896Span, 896Underline, 896whitespace, 896–897
InlineUIContainer class, 919InlineUIContainer element, 896, 899InnerException property, 120, 588innerHTML tag, 782innerText tag, 782INotifyCollectionChanged interface, 572INotifyDataErrorInfo interface, 579, 582INotifyDataError interface
BindingValidationFailed event, 585GetErrors() and HasErrors() methods, 584IDataErrorInfo interface, 582INotifyDataErrorInfo interface, 582Product.ModelNumber property, 583–584SetErrors() and ClearErrors() methods, 583ValidatesOnDataErrors property, 585ValidatesOnNotifyDataErrors property, 585
INotifyPropertyChanged interface, 566, 632InputDevice class, 121InputEventArgs class
device property, 121Timestamp property, 121
Input events, 118, 121Interaction.Behaviors attached property, 302InteractiveVisual3D, 877Internet Explorer browser engine, 742IntersectionDetail property, 378InvalidateVisual() method, 550, 552InvalidOperationException property, 756, 985IProvideCustomContentState interface, 762, 763IsAdditive property, 400IsAsync property, 597IsBrowserHosted property, 773IsChecked property, 161, 791IsColumnWidthFlexible property, 910IScrollInfo, 172IsCumulative property, 405IsDefault, 160IsDocumentEnabled property, 919IsDropDownOpen property, 192, 643IsEditable property, 643, 644IsEnabled property, 125, 164, 291
■ INDEX
1058
IsExpanded property, 176IsFlipped property, 529IsHighlighted property, 791IsInitialized property, 119IsInitialLoadEnabled property, 597IsLiveFiltering property, 663, 664IsLiveGrouping property, 663IsLiveSorting property, 663IsLoaded property, 119IsLocked property, 571, 795IsMainMenu property, 788IsMouseDirectlyOver property, 128IsMouseOver property, 128IsolatedStorageFile.AvailableFreeSpace, 776IsolatedStorageFile.GetDirectoryNames() method,
775IsolatedStorageFile.GetFileNames() method, 775IsolatedStorageFile.GetUserStoreForApplication()
method, 775IsOpen property, 164, 166IsPressed property, 791IsReadOnly property, 180, 643, 644IsRepeat property, 123IsSelected property, 639, 753IsSharedSizeScope property, 81IsSingleInstance property, 208IsSnapToTickEnabled property, 189, 235IsSubmenuOpen property, 791IsTabStop property, 125IsThreeState, 161IsTodayHighlighted, 192ISupportInitialize interface, 119IsValid property, 586IsVisible property, 291, 777Italic element, 896Item-based scrolling, 579ItemContainerStyle property, 614–617ItemContainerStyleSelector property, 614ItemsControl class, 507, 576, 602, 613–615, 622, 626,
642, 643ItemsControl.IsSynchronizedWithCurrentItem, 651ItemsPanel property, 614, 788ItemsPanelTemplate property, 577, 641, 642ItemsPresenter, 577ItemsSource DisplayMemberPath property, 788ItemsSource property, 567, 602, 614, 626, 629, 651ItemStringFormat property, 614ItemTemplate property, 567, 614, 626, 788ItemTemplateSelector property, 614, 788IValueConverter class, 606, 612, 633IValueConverter interface, 612
■ JJournalEntryName property, 760–761JournalEntry.Source property, 759journal flag, 753JournalOwnership property, 751
■ KKeepAlive property, 745, 754KeepTogether property, 911KeepWithNext property, 911Key attribute, 270Keyboard class, 126KeyboardDevice class, 126KeyboardDevice methods, 126KeyboardDevice property, 126Keyboard events, 118, 121Keyboard-handling models, 980KeyConverter, using, 124KeyDown event, 116, 122, 123KeyEventArgs object, 123, 126Key-frame animation, 442–443Key property, 123KeyStates property, 126KeyTip property, 806KeyUp event, 122
■ LLanguage integrated query (LINQ) Expression,
574–576Large fonts, 331LargeImageSource property, 803LastChildFill, 67LastModificationTime property, 928Layout
abstract, 55, 56Canvas, 82ColumnDefinition element, 88ColumnSpan property, 88DockPanel, 66
Dock, 67LastChildFill, 67setting the order of docking controls, 67
dynamic content, 88, 90Grid, 70modular user interfaces, 90nesting layout containers, 68, 70principles, 53, 54scrolling, 54ScrollViewer, 54
1059
■ INDEX
StackPanel (see StackPanel)estages of, 54Visibility property, 91WrapPanel (see WrapPanel)e
Layout arranging window components in a tabular structure, 87
LayoutTransform property, 341, 828Left property, 82Lifetime events, 118LinearGradientBrush class, 146, 325–328, 345, 415Linear interpolation, 418Linear navigation, journal management, 758LineBreakBefore property, 545–547LineBreak element, 896Line class
Canvas, 316dashes, 322–323flow content model, 316line caps, 320line joins, 320nonzero Margin, 316Stroke property, 316
LineCount property, 179LineDown() method, 171LineHeight property, 888Line-justification algorithms, 905, 906LineLeft() method, 171LineRight() method, 171LineStackingStrategy property, 888LineUp() method, 171ListBoxChrome decorator, 65ListBox class, 184–187, 566, 615, 625–627, 753ListBox control, 615, 641, 652ListBox.DisplayMemberPath property, 619ListBox.GroupStyle property, 660ListBoxItem class, 410, 614, 621, 622, 625ListBox.ItemContainerStyle property, 615, 620ListBoxItem.ContentTemplate, 620, 626ListBoxItem.IsSelected property, 616, 619, 639, 641ListBoxItem objects, 576–578, 577, 615ListBox.Items.Add() method, 629ListBox.ItemsSource property, 576ListBoxItem.Template property, 619ListBox.SelectedItem property, 571ListBox.SelectionMode property, 620ListBox.SnapsToDevicePixels property, 638ListBox.Template property, 619ListCollectionView, 647, 648, 657, 658, 663List controls, 613–615, 626
ComboBox, 187–188ItemsControl class, 183
ListBox, 184List element, 891–892ListItem collection, 903ListSelectionJournalEntry callback, 761ListSelectionJournalEntry object, 761, 762List styles
ItemContainerStyle property, 615–617item style alternation, 620–622ListBox
CheckBox elements, 617, 618ListBoxItem, 618RadioButton elements, 617–619
style selectorsbackground color, 624Binding.SourceUpdated, 625bold formatting, 624Category property, 624DataTable.RowChanged, 625ItemContainerStyleSelector property, 625Resources collection, 622rudimentary selector, 622SelectStyle() method, 622–624SingleCriteriaHighlightStyleSelector, 624
ListView, 566, 665advantages, 666Custom View
DataTemplate, 671DefaultStyleKey property, 670GridView class, 675ImageDetailView, 676ItemContainer.DefaultKeyStyle property,
670passing information, 677–678ResourceKey, 670TileView objects, 676View class, 672–673view objects, 675View styles, 673–675
GridView, 666cell templates, 668–670column creation, 667column headers, 670resizing columns, 668
ListBox class, 665ViewBase class, 665
LiveFilteringProperties, 664LiveGroupingProperties, 664Live shaping, 663–664LiveSortingProperties, 664LoadAsync() method, 814LoadCompleted event, 757, 781
■ INDEX
1060
LoadedBehavior property, 818, 819, 820, 824Loaded event, 119LoadFile() method, 203Load() method, 814Localization
BAML resources, 218building user interfaces, 218–219CurrentUICulture property, 218default culture, 219fine-grained, 219GAC, 220language, 219probing, 218satellite assembly, 220translation process
extracting localizable content, 221–224markup elements preparation, 220–221satellite assembly building, 224–226
user-interface, 218.vbproj .csproj file, 219
Lock() method, 390Logical scrolling, 172LookDirection property, 868Lookless control, 505, 506
color picker code, 520color picker markup
ColorPicker.xaml file, 522generic.xaml file, 520–521OverrideMetadata, 520TemplateBinding markup extensio, 522–523theme-specific styles, 521–522
control templateadding part names, 524–525documenting template parts, 526–527event handlers, 524manipulating template parts, 525–526
Losing a mouse capture, 130LostFocus event, 120, 980LostMouseCapture event, 130LowerLatin value, 891LowerRoman value, 891
■ MMain() method, 196MainWindow, 799Managed Add-in Framework (MAF), 997–998Managed Extensibility Framework (MEF), 997–998Manipulation, 133, 136, 139Margin property, 58, 887MarkerOffset property, 891
MarkerStyle property, 891Markup-based approach, 653MaskedTextBox, 973–974MaskInputRejected event, 974MatrixCamera class, 846MatrixTransform class, 338MaxHeight property, 58MaxLines property, 179MaxWidth property, 58Measure() met, 542, 543MeasureOverride() method, 541–542, 544MediaClock class, 820MediaCommands class, 819MediaElement class, 549, 815
animation synchronization, 825–827error handling, 819playing audio with triggers, 820–822playing multiple sounds, 822–823playing video, 827Position control, 825programmatic audio play, 818–819SpeedRatio control, 824video effects (see Video effects)e
Clipping property, 828content control, 827copying content, 828intermediary rendering surface, 830LayoutTransform property, 828Opacity property, 828reflection effect, 828–829RenderTransformOrigin property, 828RenderTransform property, 828resolutions and frame rates, 830VideoDrawing class, 830
Volume and Balance control, 823–824MediaElement.Clock information, 825MediaElement.Source property, 820MediaElement.SpeedRatio property, 824MediaEnded event, 825MediaFailed event, 817, 819MediaOpened event, 817MediaPlayer class, 816–818, 823, 830MediaPlayer.Close() method, 816MediaState enumeration, 818MediaTimeline class, 403, 820, 823MediaTimeline.Source property, 820MediumSpeedProperty, 598MemoryStream, 923Menu class, 614MenuItem class, 789–791MenuItem.Click event, 790
1061
■ INDEX
MenuItem.Icon property, 791MenuItem.InputGestureText property, 791MenuItem.IsChecked property, 791MenuItem objects, 789, 791Menus
ContextMenu class, 791items, 789–791Menu class, 788Separators, 792–793
MergedDictionaries property, 278–279MessageBeep Win32 API, 816Message property, 588Microsoft.Expression.Interactions.dll assembly,
299, 303Microsoft HTML Object Library, 781Microsoft Money, 742MinHeight property, 58MinLines property, 179MinOrphanLines property, 911MinWidth property, 58MinWindowLines property, 911Miter line join, 321Mixed menus, 787Model3DGroup class, 857ModelUIElement3D class, 871, 873–874MonitorCommands, 266MouseButton event, 129MouseButtonEventArgs object, 113, 129Mouse.Capture() method, 129Mouse class, 129Mouse cursors, 151–152MouseDoubleClick event, 129MouseDown event, 872, 919MouseEnter event, 127, 289, 290, 296MouseEventArgs object, 107, 127Mouse events, 118
AllowDrop property, 131ButtonState event, 129capturing the mouse by calling Mouse.Capture()
method, 129ClickCount event, 129creating drag-and-drop source, 131direct events, definition of, 127drag-and-drop operations, 130DragDrop class, 131DragEnter event, 131dragging-and-dropping into other applications,
132IsMouseDirectlyOver property, 128IsMouseOver property, 128LostMouseCapture event, 130
MouseButton event, 129MouseButtonEventArgs object, 129mouse class, 129mouse click events, 128MouseDoubleClick event, 129MouseEnter event, 127MouseLeave event, 127MouseMove event, 127PreviewMouseDoubleClick event, 129PreviewMouseMove event, 127
MouseLeave event, 127, 289, 290, 297MouseLeftButton, 374MouseLeftButtonDown event, 128MouseLeftButtonUp event, 129MouseMove event, 127Mouse.OverrideCursor property, 152MouseRightButtonDown event, 128MouseRightButtonUp event, 129MouseUp() method, 108MultiBinding, 612MultiBinding.StringFormat property, 612MultiDataTrigger class, 294Multiple views, 653Multithreading
BackgroundWorker (see BackgroundWorker)econtext, 983definition, 983dispatcher, 984DispatcherObject class, 984
BeginInvoke() method, 986, 987Dispatcher.BeginInvoke() method, 985, 986DispatcherPriority.ApplicationIdle, 986DispatcherPriority.Normal, 986DispatcherPriority.SystemIdle, 986InvalidOperationException, 985Invoke() method, 987members, 984System.Threading.Thread object, 985time-consuming code, 986UpdateTextWrong() method, 985VerifyAccess() method, 985
dual-core CPUs, 983element, 984single-threaded apartment model, 984thread affinity, 984thread rental, 983
Multitouch input, 132, 140MultiTrigger class, 294, 296MyPageData property, 755myTextBox element, 748
■ INDEX
1062
■ NNavigated event, 757, 781Navigate() method, 756, 781, 782NavigateToStream() method, 781NavigateToString() method, 781NavigateUri property, 746, 896Navigating event, 757, 781NavigationFailed event, 747, 757NavigationFailedEventArgs.Handled, 757NavigationProgress event, 757NavigationService class
events, 756–757journal
AddBackEntry() method, 759AddBackReference() method, 763CustomContentState class, 760CustomContentState object, 763custom entries, 764, 766dynamic list, 760GetContentState() method, 762, 763IProvideCustomContentState interface, 762,
763JournalEntryName property, 760–761JournalEntry object, 759ListSelectionJournalEntry callback, 761ListSelectionJournalEntry object, 762management, 758–759NavigationService.Content property, 761PageWithMultipleJournalEntries, 763ReplayListChange delegate, 761Replay() method, 761–763System.Windows.Navigation.
CustomContentState class, 759“virtual” entries, 759
Page Functions (see PageFunction class)eprogrammatic navigation, 755–756
NavigationService.Content property, 761NavigationService.GetNavigationService() method,
755NavigationService.Navigate() method, 764, 765NavigationService property, 745NavigationService.StopLoading() method, 756NavigationStopped event, 757NavigationUIVisibility property, 749, 751NavigationWindow, 742–744, 752, 769Nested page, 750.NET Framework, 771non-MenuItem objects, 790Nonshared resources, 274Nonzero fill rule, 319
NotifyPropertyChanged property, 663
■ OObjectAnimationUsingKeyFrames, 394Object-based drawing, 18ObjectDataProvider, 595
asynchronous support, 597binding, 596error handling, 596–597features, 596GetProducts() method, 596
Object resource, 269access, code, 275adaptability, 269application, 275–276collection, 270–271dynamic resource, 272–274efficiency, 269maintainability, 269nonshared, 274static resource, 272–274system, 276–277
ObservableCollection class, 572, 575, 602Office ribbon, 787OnApplyTemplate() method, 525, 536–537onBlur event, 785onChange event, 785onClick event, 785OnColorChanged() method, 512, 513OnColorRGBChanged() method, 512OneWayToSource binding, 580onFocus event, 785OnMainWindowClose approach, 198onMouseOver event, 785OnPropertyChanged() method, 566OnRender() method, 154, 371, 548–550OnReturn() method, 765, 766OnStartup() method, 208OpacityMask gradient, 828OpacityMask property, 344Opacity masks, 414Opacity property, 325, 342, 344, 826, 828Open() method, 816, 817Optimal paragraph layout, 905Ordinary property, 754Orientation property, 794orizontalContentAlignment property, 156OrthographicCamera class, 846Oscillations property, 418outerHTML tag, 782
1063
■ INDEX
outerText tag, 782Overflow menu, 794–795OverflowMode.Always, 795OverflowMode.AsNeeded, 795OverflowMode.Never, 795OverflowMode property, 795OverrideMetadata() method, 520
■ PPackageStore.GetPackage() method, 931Padding property, 69, 514, 887, 899Page-based interfaces. See Page-based navigationePage-based navigation
application with NavigationWindow, 743–744custom property maintenance, 754–755events, 756–757hosting pages
in another page, 750–751in Frame, 748–750in Web Browser, 751–752
hyperlinksClick event, 746fragment navigation, 748inline flow elements, 745NavigateUri property, 746navigating to websites, 747Page.ShowsNavigationUI property, 746RequestNavigate event, 746TextBlock element, 745visited pages history, 746WindowTitle property, 747
Internet Explorer browser engine, 742journal
AddBackEntry() method, 759AddBackReference() method, 763CustomContentState class, 760CustomContentState object, 763custom entries, 764, 766dynamic list, 760GetContentState() method, 762, 763IProvideCustomContentState interface, 762,
763JournalEntryName property, 760–761JournalEntry object, 759ListSelectionJournalEntry callback, 761ListSelectionJournalEntry object, 762management, 758–759NavigationService.Content property, 761PageWithMultipleJournalEntries, 763ReplayListChange delegate, 761
Replay() method, 761–763System.Windows.Navigation.
CustomContentState class, 759“virtual” entries, 759
navigation events, 756navigation history, 753–754Navigation Service (see NavigationService class)ePage class, 744–745Page Functions (see PageFunction class)eprogrammatic navigation, 755–756System.Windows.Controls.Page class, 742URIs, WPF, 752–753WebBrowser control (see WebBrowser control)eweblike applications, 742weblike interface, 742websites vs. Windows applications, 741XAML file, 742XBAPs (see XAML browser applications (XBAPs))e
Page class, 744–745PageDown() method, 171PageFunction class
creation, 764OnReturn() method, 765, 766Product class, 764programmatic navigation, 765RemoveFromJournal property, 766Returned event, 765TypeArguments attribute, 764, 765
<PageFunction> element, 764Page.Initialized event, 755Page.KeepAlive property, 754PageLeft() method, 171PageLibrary component, 752Page.Loaded event, 744, 755PageRight() method, 171Page.ShowsNavigationUI property, 746PageUp() method, 171Panel class, 507, 549Paragraph element, 890Paragraph properties, 911Parse() method, 606PasswordBox, 179PasswordBox.PasswordChar property, 100Path-based animation, 446–448PathGeometry object, 394Path shape, 338Pause() method, 819PauseStoryboard action, 411PerspectiveCamera class, 846Pixel-based scrolling, 579Pixel snapping, 324
■ INDEX
1064
PlacementMode, 164Placement property, 776PlacementRectangle property, 164PlacementTarget property, 164PlayLooping() method, 814Play() method, 814, 816, 817, 819, 822, 823PlaySync() class, 815PlaySync() method, 814Plug-ins. See Add-insePointLight and SpotLight, 846Polygon class, 308, 318–320Polyline class, 308
dynamic graphics, 318Expression Design, 318line caps, 320line joins, 320PointCollection object, 317Points property, 317with several segments, 317
Pop() method, 370PopupAnimation property, 167, 776Popup.Child property, 167Popup.StaysOpen property, 167Position property, 825PositivePriceRule, 587PowerEase class, 421Prebuilt commands, 246PreviewKeyDown event, 116, 122, 124PreviewKeyUp event, 122PreviewMouseDoubleClick event, 129PreviewMouseLeftButtonDown event, 128PreviewMouseLeftButtonUp event, 129PreviewMouseMove event, 127PreviewMouseRightButtonDown event, 128PreviewMouseRightButtonUp event, 129PreviewTextInput event, 122, 123, 124PreviewTouchDown event, 133PreviewTouchMove event, 133PreviewTouchUp event, 133PriceConverter class, 607Primary interop assembly, 976PrintDocument() method, 244Printing, 935
an element, 936in-memory TextBlock object, 941limitations, 937PrintDialog object, 936PrintVisual() method, 937
annotations, 944document
ColumnWidth and ColumnGap, 943
DocumentPaginator property, 943FlowDocumentPageViewer, 943FlowDocumentReader, 943limitations, 944PrintDocument() method, 942
Document paginator, 945GetPage() method, 946HeaderedFlowDocumentPaginator class,
945–946, 947PageCount, 946PageSize, 946
with multiple pagesdata split, 951DocumentPaginator, 951DrawText() and DrawLine() methods, 955GetFormattedText() method, 953GetPage() method, 951, 954PaginateData() method, 952StoreDataSetPaginator, 952, 956
page ranges, 957PrintDialog class, 938
PrintDocument() method, 936PrintVisual() method, 936
print queues, 957–960print settings, 956Transform object, 938
Canvas, 939Measure() and Arrange() methods, 939PrintableAreaWidth and
PrintableAreaHeight properties, 939–940visual-layer classes
ContainerVisual, 948custom printout, 948, 950DrawingContext methods, 948–949DrawingVisual, 948
XPS documentsasynchronous printing, 961, 963–964DocumentPaginator, 960MemoryStream, writing to, 962PrintDialog class, 962print preview, 961Write() and WriteAsync() methods, 961
Print() method, 912ProductByPriceFilter object, 655, 656Product.CategoryName property, 660Product class, 764Product.Description property, 564productMatchesTracked collection, 575Product.ModelName property, 626Product.ModelNumber property, 598, 602Product objects, 628
1065
■ INDEX
Product.UnitCost property, 606, 664Programmatic navigation, 755–756ProgressBar content, 416ProgressBar control, 190ProgressBar.Value, 417ProgressChanged event, 992PromptBuilder.AppendSsml() method, 833PromptBuilder.BeginStyle() method, 832PromptBuilder class, 831–833PromptBuilder.ToXml() method, 833PromptEmphasis, 832PromptRate value, 832PromptStyle object, 832PromptVolume value, 832Property-based animation, 392–393PropertyChanged event, 566, 625PropertyChanged property, 565PropertyGroupDescription.Name property, 660PropertyMap collection, 981PropertyNameChanged property, 565Property-resolution system, 399Property translators, 980Proportional coordinate system, 329Proportionally sized tiles, 332proportional scaling, 315PushClip() method, 371PushEffect() method, 371PushOpacityMask() method, 371PushOpacity() method, 371PushTransform() method, 371PushXxx() methods, 371
■ QQuadraticEase class, 421QuarticEase class, 421Quick Access Toolbar (QAT), 809–810QuickAccessToolBarImageSource property, 810QuinticEase class, 421
■ RRadialGradientBrush class, 325, 329–330, 552RadioButton elements, 617–620RadioButton.Focusable property, 619RadioButton.IsChecked property, 619RadioButton objects, 373RadiusX property, 310, 329RadiusY property, 310, 329RaiseEvent() method, 107, 513RangeBase class, 525Range-based controls
ProgressBar, 190properties, 188slider, 188–190
RangeBase-derived control, 525Raw touch support, 133, 136record browser, 649, 650Rectangle class, 308, 310Rectangle.Fill property, 513Rectangle geometry, 348Refresh() method, 781RegisterEvent() method, 110RegisterPixelShaderSamplerProperty() method, 384RegisterRoutedEvent() method, 106RelativeSource property, 522RelativeTransform property, 828RemoveBackEntry() method, 758RemoveFromJournal property, 766RemoveHandler() method, 106RemoveRequested event, 416RemoveSignature() method, 920RemoveStoryboard action, 411RenderedGeometry property, 309RenderTransformOrigin property, 340, 341, 828RenderTransform property, 339, 341, 828RepeatBehavior property, 405–406RepeatButton, 160Repeat interval, 405Replay() method, 761–763RequestNavigate event, 746ResizeBehavior property, 77ResizeDirection property, 77ResourceDictionary class, 270ResourceKey objects, 277ResourceKey property, 272Resources
assembly resource, 269dictionary
ComponentResourceKey, 279–282creation, 277CustomResources, 280generic.xaml, 279ImageSource property, 281library assembly, 281MergedDictionaries property, 278–279merging resource collection, 278–279ResourceDictionary object, 278, 279ResourceLibrary, 280ReusableDictionary.xaml, 279
object resource (see Object resource)eResources property, 270, 287ResumeStoryboard action, 411, 822
■ INDEX
1066
Retrieving resources, 214–215ReturnEventArgs.Result property, 765Reversible animation, 402RGB and scRGB, 145RibbonApplicationMenu class, 800RibbonApplicationMenuItem class, 800RibbonApplicationMenuItem objects, 800, 804Ribbon.AuxiliaryPaneContent, 802RibbonButton objects, 802–804, 804, 807RibbonCheckBox class, 804RibbonComboBox class, 804RibbonControlsLibrary.dll assembly, 798Ribbon.FooterPaneContent, 802RibbonGroup objects, 802–804RibbonGroupSizeDefinitionCollection, 808RibbonGroupSizeDefinition objects, 807RibbonMenuButton class, 804Ribbon.QuickAccessToolBar property, 809RibbonRadioButton class, 804Ribbon.Resources, 808Ribbons
adding, 798–780application menu, 800–802keyboard access with KeyTips, 806Microsoft, 798QAT, 809–810rich tooltips, 804–805sizing, 807–809Tabs, Groups, and Buttons, 802–804Windows applications, 798
RibbonSeparator class, 804RibbonSplitButton class, 804RibbonTab objects, 802–804RibbonTest, 799RibbonTextBox class, 804RibbonToggleButton class, 804RibbonWindow class, 798–800RibbonWrapPanel, 807RichTextBox control, 179
file loadingdata format, 914–915Load() method, 914System.Windows.Documents.TextRange
class, 886TextRange, 913–914XamlReader.Load() method, 913
FlowDocument object, 913individual words, 919MouseUp event, 919PreviewMouseDown event, 919saving file, 915–916
text formatting, 916–918UIElement objects, 919
RichTextBox.IsDocumentEnabled property, 919RichTextBox.Selection property, 917Right property, 82RotateTransform class, 337, 339RotateTransform3D, 866–867, 878Round line join, 321RoutedCommand class, 246–247RoutedEventArgs class, 107, 110RoutedEventArgs.Handled property, 113, 757RoutedEventHandler property, 513Routed events
AddHandler() method, 106, 108, 114attached events, 114bubbled image click, 111click event, 114definition of, 105delegate type, 108MouseEventArgs object, 107name property, 115naming event handler methods, 107RaiseEvent() method, 107RegisterEvent() method, 110RegisterRoutedEvent() method, 106registration, 105RemoveHandler() helper method, 109RemoveHandler() methods, 106RemoveHandler statement, 108sharing, 106signatures, 107suppressed events, 114tunneling events (see Tunneling events)etypes of, 109wiring up, attached event, 115wrapping of, .NET events, 106
RoutedPropertyChangedEventHandler property,513
RoutedUICommand object, 516RowDefinition element, 70Row property, 71RowSpan property, 894Run element, 890, 895Runtime callable wrappers (RCWs), 976RunWorkerCompleted event, 994RunWorkerCompletedEventArgs.Result property,
991
■ SSayAs enumeration, 832
1067
■ INDEX
ScaleTransform, 540ScaleTransform class, 337ScrollToEnd() method, 171ScrollToHome() method, 171ScrollToHorizontalOffset() method, 171ScrollToLeftEnd() method, 171ScrollToRightEnd() method, 171ScrollToVerticalOffset() method, 171ScrollToXxx() methods, 171ScrollViewer, 577, 778
custom scrolling, 172–173definition, 170expander, 175–178GroupBox, 173HorizontalScrollBarVisibility property, 170horizontal scrolling, 170programmatic scrolling, 171–172scrollable window, 170scrollbar, 170TabItem, 173–175
ScrollViewer.HorizontalScrollBarVisibility property, 641
Section.Background property, 894Section element, 894–895Section.Style property, 895SecureString.Dispose() method, 183SecurityException, 772SeekStoryboard action, 411SelectedIndex property, 615, 753SelectedItem.Products property, 571SelectedItem property, 571, 615SelectedText property, 180SelectedValue propertry, 615SelectionBoxItemTemplate property, 645SelectionChanged event, 180SelectionChangedEventArgs object, 186SelectionMode propertry, 615Selector class, 507, 615, 642SelectStyle() method, 622Separator objects, 789SetBinding() method, 525SetProperty() method, 544SetSpeedRatio() method, 414SetStoryboardSpeedRatio action, 411, 824SetStoryboardSpeedRatio.SpeedRatio action, 414Setters property, 286Setter.TargetName property, 287SetValue() method, 100, 511SetZIndex() method, 84ShaderEffect class, 383–384Shape classes, 549
Shapesangling, 338animation, 338classes
ellipse class, 308, 310LayoutTransform property, 341line class (see Line class)epolygon class, 308, 318–320polyline class (see Polyline class)erectangle class, 308, 310
elements, 307–308FrameworkElement, 307pixel snapping, 324primitives, 307properties, 309repeating, 338scaling with Viewbox
autosized container, 316Canvas.ClipToBounds property, 315Canvas with resizability, 314DPI setting, 315non-Viewbox size, 315StretchDirection property, 315vector graphics, 314Viewbox.Stretch property, 315Width and Height properties, 315window resizing, 315
sizing and placing, 311–313transforming, 339–340
Shared attribute, 274SharedLibrary assembly, 753SharedSizeGroup property, 627ShowDuration property, 166ShowGridLines property, 70Show() method, 745ShowOnDisabled property, 167ShowsNavigationUI property, 745ShowsPreview property, 77ShutdownMode property, 198Sieve of Eratosthenes, 988SignDigitally() method, 920Silverlight, 299SineEase class, 421SingleCriteriaHighlightStyleSelector, 624–625SingleCriteriaHighlightTemplateSelector, 634Single-instance application
Application.Startup event fires, 207building document-based applications, 207file-type registration, 211–212IsSingleInstance property, 208Microsoft Word, 207
■ INDEX
1068
Single-instance application (cont.)ttOnStartup() method, 208OnStartupNextInstance() method, 208ShowDocument() window, 207SingleInstanceApplicationWrapper class, 209WCF, 207WindowsFormsApplicationBase, 207, 208WpfApp class, 208, 210
SingleInstanceApplicationWrapper class, 209SingleInstanceApplicationWrapper.
OnStartupNextInstance() method, 211Single-thread affinity (STA), 13Single-threaded apartment model, 984SizeToContent property, 64, 178SkewTransform class, 339SkipStoryboardToFill action, 411Slider controls, 513Slider.Value property, 414SlowSpeedProperty, 598SmallImageSource property, 802, 803Snapshot-and-replace behavior, 409SnapshotAndReplace value, 409SnapsToDevicePixels property, 309, 324SolidColorBrush class, 325–326, 342, 513, 525SolidColorBrush objects, 145SolidColorBrush property, 927Solution Explorer, 968, 977SomethingClicked() method, 112, 113SortByModelNameLength class, 658SortByTextLength class, 658SortDescription objects, 657, 658SortDescriptions collection, 658SortDescriptions property, 652SoundLocation property, 814SoundPlayerAction class, 815SoundPlayer class, 813–815SoundPlayer.Stream property, 814SourceInitialized event, 120SourceItems property, 761Source property, 782, 823Span element, 890, 896Span.Tag property, 903SpashScreen.Show() method, 202SpecularMaterial, 859, 860SpeechDetected event, 833SpeechHypothesized event, 833Speech recognition
COM object, 833Dispose() method, 833GrammarBuilder, 834SpeechDetected event, 833
SpeechHypothesized event, 833SpeechRecognitionRejected event, 833SpeechRecognizer class, 833SRGS grammar, 834SubsetMatchingMode enumeration, 834Windows accessibility feature, 833
Speech Recognition Grammar Specification (SRGS),834
SpeechRecognitionRejected event, 833SpeechRecognized event, 833SpeechRecognizedEventArgs.Result property, 833SpeechRecognizer class, 833Speech synthesis
dynamic text, 831Narrator, 831PromptBuilder class, 831–833SpeechSynthesizer class, 831SSML standard, 832System.Speech.Synthesis namespace, 831
Speech Synthesis Markup Language (SSML) standard, 832
SpeechSynthesizer class, 831SpeedRatio property, 284, 404, 411, 414SpellCheck.CustomDictionaries collection, 183SpellCheck.CustomDictionaries property, 182SpellCheck.IsEnabled property, 182SpellingReform property, 181Splash Screen, 202SplashScreen.Close() method, 202Spline key frames animation, 444–448SpreadMethod property, 328Square value, 891SrgsDocument, 834Stack collection, 517StackPanel, 311, 341, 659
arranging elements, 58Border class, 64button sizing, 62, 63button stack example, 56changing alignment defaults, 59FrameworkElement class, 59Height property, 62HorizontalAlignment property, 59in horizontal orientation, 58layout properties, 58setting control margins, 60SizeToContent property, 64Thickness structure, 60VerticalAlignment property, 59in Visual Studio, 57Width property, 62
1069
■ INDEX
window, 64StackPanel.Visibility property, 641StartLineCap property, 320StartPoint property, 327StartupEventArgs.Args property, 203StartupUri property, 197StartVoice() method, 832StaticResource reference, 628Static resources, 271StatusBar class, 793, 796–797StatusBarItem object, 797StaysOpen property, 164, 776StickyNoteControl class, 932–933StickyNoteControl.IsActive property, 932Stitching. See Z-fightingeStop() method, 819StopStoryboard action, 411StoreContentChanged event, 931StoreDB.GetProduct() method, 559, 568–569Storyboard.CurrentTimeInvalidated event, 825, 826Storyboards, 396, 406
declarative animation, 406definition, 406DoubleAnimation, 406event trigger (see Event triggers)emonitoring progress, 415–417overlapping animations, 409–410playback control
BeginStoryboard action, 411, 412, 414BeginStoryboardName property, 414controllable animation, 412ControllableStoryboardAction class, 411EventTrigger.SourceName property, 413media player actions, 413Name property, 414PauseStoryboard action, 411SetSpeedRatio() method, 414stopping vs. completing animation, 412Storyboard object, 414Triggers collection, 413wipe effect, 414
synchronized animations, 410–411TargetName property, 406TargetProperty, 406Timeline, 411
Storyboard.SlipBehavior property, 825Storyboard.TargetName property, 407Storyboard.TargetProperty property, 407Straight lines, 355StreamResourceInfo object, 215StreamSource property, 608
StretchDirection property, 315, 827Stretch property, 309, 312, 331, 334, 827StringAnimationUsingKeyFrames, 394StringFormat property, 612String formatting, 603
StringFormat propertyBinding.StringFormat property, 603ItemStringFormat property, 605.NET format strings, 603numeric data, 604OrderDate property, 604StringFormat value, 604times and dates, 604UnitCost property, 603Visual Studio, 604XAML parser, 604
with value convertersBinding.StringFormat property, 605creation, 606DataBinding namespace, 607Decimal.ToString() method, 606Parse() method, 606PriceConverter class, 607Product.UnitCost property, 606Resources collection, 607StaticResource reference, 607System.Globalization.NumberStyles value,
606ToString() method, 606TryParse() method, 606XML namespace prefix, 607
StrokeDashArray property, 309, 322StrokeDashCap property, 309, 323, 324StrokeDashOffset property, 309, 323StrokeEndLineCap property, 309StrokeLineJoin property, 309StrokeMiterLimit property, 309, 321Stroke objects, 84Stroke property, 309, 310Strokes collection, 84StrokeStartLineCap property, 309StrokeThickness property, 309Style inheritance, 292Style property, 527, 887Styles, 283, 505
advantages, 286attaching event handlers, 289–291automatic application, types, 292–293BigFontButtonStyle, 285, 286data types, 284definition, 283
■ INDEX
1070
Styles (cont.)ttdependency property, 283FindResource() method, 285font properties, 283FontSettings object, 285FontWeight.Bold, 284layers, 291list (see List styles)ePadding and Margin properties, 286programmatical, 285property value inheritance feature, 284Setter object, 285setting properties
attribute with nested element, 288Button class, 289Control class, 289dependency property, 288, 289Label class, 289Setter objects, 288TargetType property, 289TextBlock class, 289
static resources, 284Style class properties, 286Style object creation, 287Style property, 285System.Windows.Style object, 285triggers (see Triggers)etriggers and templates, 283vs. CSS, 283window resources, 284Windows Forms, 970–971
Style selectors, 611Style.TargetType property, 616, 932Style triggers, 617Stylus events, 118SubsetMatchingMode enumeration, 834SynchronizationContext class, 992SystemBrushes class, 325System.Collections.Generic namespaces, 517SystemColors class, 276System.ComponentModel.BackgroundWorker
component, 987System.ComponentModel.INotifyPropertyChanged
interface, 565System.ComponentModel namespace, 989System.ComponentModel.
PropertyGroupDescription objects, 659System.ComponentModel.SortDescription objects,
657System DPI
font size, 7
higher pixel density, 8scaling, 10Windows 7 and 8, 9Windows Vista, 8
System.Drawing.dll assembly, 968System.Drawing namespace, 276SystemFontFamilies collection, 149SystemFonts class, 276System.Globalization.CultureInfo class, 224System.IO.Compression namespace, 776System.IO.IsolatedStorage namespace, 775System.IO.Packaging namespace, 931System.Linq.Enumerable helper class, 575System.Linq namespace, 575System.Media.SystemSounds class, 816SystemParameters class, 276System resources, 276–277System.Runtime.InteropServices namespace, 784System.Security.Principal.WindowsIdentity class,
926System.Security.SecureString object, 183SystemSounds class, 816System.Speech.Recognition namespace, 833System.Speech.Recognition.SrgsGrammar
namespace, 834System.Speech.Synthesis namespace, 831System.Threading.DispatcherObject, 13System.Threading.Thread, 984System.TimeSpan, 401System.Windows.Annotations namespace, 922, 925System.Windows.Annotations.Storage namespace,
922System.Windows.Application class, 971System.Windows.Clipboard class, 132System.Windows.Control class, 144System.Windows.Controls.ContentControl, 15System.Windows.Controls.Control, 14System.Windows.Controls.Decorator class, 65System.Windows.Controls.ItemsControl, 15System.Windows.Controls namespace, 797, 932System.Windows.Controls.Page class, 742System.Windows.Controls.Panel, 15, 641System.Windows.Controls.Primitives namespace,
797System.Windows.Controls.Primitives.RangeBase
class, 525System.Windows.Data.Binding class, 229System.Windows.Data.CollectionViewSource class,
648System.Windows.DependencyObject, 14System.Windows.Documents.TextRange class, 913
1071
■ INDEX
System.Windows.Forms.Application class, 971System.Windows.Forms.dll assembly, 968System.Windows.Forms.Form class, 778System.Windows.Forms.Integration.ElementHost
class, 976–978System.Windows.Forms.Integration namespace,
970, 973System.Windows.Forms namespace, 973System.Windows.FrameworkElement, 14System.Windows.Freezable class, 146System.Windows.Input.Cursor object, 151System.Windows.Input.MediaCommands class, 819System.Windows.Interactivity.dll assembly, 299, 303System.Windows.Interop.HwndHost class, 982System.Windows.Markup namespace, 911System.Windows.Media.Animation namespace,
393–395, 417System.Windows.Media.Brush, 325System.Windows.Media.Color object, 510System.Windows.Media namespace, 816System.Windows.Media.Transform class, 337System.Windows.Media.Visual, 14System.Windows.Navigation.CustomContentState
class, 759System.Windows.Shapes.Shape class, 14, 308System.Windows.SystemColors, 144System.Windows.Threading.Dispatcher class, 984System.Windows.UIElement, 14
■ TTabControl, 173TableCell element, 892–893TableColumn objects, 894Table element, 892–894TableLayoutPanel, 976TableRow element, 892TableRowGroup element, 892Table.Rows property, 894TabStripPlacement property, 174tagName tag, 782Tag property, 823TargetInvocationException, 588TargetInvocationException.Message property, 588TargetItems property, 761TargetName property, 406TargetNullValue property, 564TargetProperty, 406TargetType property, 287, 293TargetZone, 768Taskbar programming
jump lists, 729in code, 732–733custom jump list, 730–732JumpListApplicationTask, 733JumpTask, 733launch applications, 733properties, 731recent document support, 729–730
overlay icons, 738progress notification, 737thumbnail buttons, 736–737thumbnail preview, 734
TemplatePart attributes, 526, 531Template selectors, 611, 632–636TestApplication.App., 197TextAlignment property, 887, 905TextAnchor object, 930TextBlock class, 549, 907TextBlock element, 293, 416, 753TextBlock.FontFamily property, 289TextBlock.FontSize property, 235TextBlock.Foreground property, 328TextBlock.Inlines collection, 907TextBoxBase, 179TextBox control, 122, 507, 753TextBox objects, 588TextBox.Tag property, 904TextChanged event, 122, 656TextCompositionEventArgs object, 123Text controls
multiple lines, 179–180PasswordBox, 179, 183RichTextBox control, 179spell check, 181–183TextBox control, 179text selection, 180–181
TextDecorations property, 148, 888TextInput event, 122, 123Text justification, 905–906TextMarkerStyle enumeration, 891TextOptions.TextFormattingMode, 151TextPointer objects, 914Text property, 753TextRange class, 913–914, 917TextRange.Load() method, 914, 916TextRange.Save() method, 915TextRange.Text property, 918TextSearch.TextPath property, 644TextSelection.GetPropertyValue() method, 917TextSelection object, 917TextTrimming property, 907
■ INDEX
1072
Texture mappingImageBrush mapping
bitmap paint, 861Positions collection, 863TextureCoordinates collection, 862, 863textured cube, 862
video and the VisualBrush, 864–865TextWrapping property, 158, 907ThicknessAnimation class, 393Thread affinity, 984Thread rental, 9833-D drawing
advantages, 838camera
axis lines, 849complete 3-D scene, 849FieldOfView property, 850final scene, 849LookDirection property, 868MatrixCamera class, 846NearPlaneDistance and FarPlaneDistance
properties, 850OrthographicCamera class, 846PerspectiveCamera class, 846positioning and angling, 848Position property, 847z-fighting, 850
complex shapes, 856DiffuseMaterial, 859, 860EmissiveMaterial, 859four ingredients:, 837interactivity and animations
fly over, 868hit testing (see Hit testing)erotations, 866–867trackball, 870–871transforms, 865–866
MaterialGroup, 859Model3DGroup collections, 857, 858shading and normals
blending illumination, 854cube with lighting artifacts, 852front face of cube, 853normal calculation, 854, 855Positions collection, 854smoothening blending, 855visible faces of cube, 853
SpecularMaterial, 859texture mapping (see Texture mapping)e3-D cube creation, 8513-D objects (see 3-D objects)e
3-D performance, 869–8702-D elements on 3-D surfaces, 875–878Viewport3D class, 838
3-D objectsdefinition, 840GeometryModel3D class
material classes, 843properties, 843
light sourcesadding to viewport, 845, 846AmbientLight, 846light classes, 844lighting calculation, 844white DirectionalLight, 844
MeshGeometry3Dcoordinate system, 841Normals, 841positions, 841TextureCoordinates, 841triangle definition, 840TriangleIndices, 841
vs. 2-D drawing classes, 839Three-dimensional surface, 828TickBar element, 550TickPlacement, 189TileBrush, 336, 342Tiled ImageBrush class, 332–335TileMode enumeration, 334TimeLine class, 404Timeline class
AccelerationRatio property, 404–405AnimationTimeline, 403DecelerationRatio property, 404–405MediaTimeline, 403properties, 404RepeatBehavior property, 405–406TimelineGroup, 403
Timeline.DesiredFrameRate attached property, 426TimelineGroup class, 403Timer-based animation, 391–392TimeSpan object, 401Timestamp property, 121ToArray() method, 575ToggleBold command, 916ToggleButton, 160, 531, 533, 537ToggleItalic command, 916ToggleUnderline command, 916ToList() method, 575Toolbars
Button, 793CheckBox, 793, 794
1073
■ INDEX
ComboBox, 793definition, 793different controls, 794HeaderedItemsControl, 794LayoutTransform, 794Orientation property, 794overflow menu, 794–795RadioButton, 793Separator, 793ToggleButton, 793ToolBarTray, 795–796
ToolBarTray, 795–796ToolTipClosing, 166ToolTipDescription property, 805ToolTipFooterDescription property, 805ToolTipFooterImageSource property, 805ToolTipFooterTitle property, 805ToolTipImageSource property, 805ToolTipOpening, 166ToolTip property, 804–805, 887ToolTipService class, 166–167ToolTipTitle property, 805Top property, 82To property, 399–400ToString() method, 124, 154, 174TouchDown event, 133TouchEnter event, 134TouchLeave event, 134TouchMove event, 133TouchUp event, 133Transform3D class, 839TransformGroup class, 338Transform object, 309Transforms, 865–866
classes, 337definition, 337elements, 341Freezable, 338shapes, 338
TranslateTransform class, 337Transparency
opacity masks, 344–346semitransparent element, 342semitransparent layers, 342–343XAML contents, 343
TravelProductStyle, 622TreeView, 571, 577, 665
controls, 686data-binding
categories and products, 679DataSet, 682–683
hierarchical data, 679HierarchicalDataTemplate, 681ItemTemplate, 682templates, 681
flexibility, 678HeaderedItemsControl class, 678just-in-time node creation
directory-browsing application, 683Expanded event, 685FileSystemWatcher, 686placeholder, 685System.IO.DriveInfo class, 684
WPF’s implementation, 678TreeView class, 614TriggerAction, 815Trigger class, 294Trigger.EnterActions property, 297, 409Trigger.ExitActions property, 297Triggers
Button.IsPressed property, 295Conditions collection, 296control template, 295event trigger, 296–298formatting, 296FrameworkElement.Triggers collection, 294keyboard focus button, 294multiple triggers, 295pre-trigger value, 295Style.Triggers collection, 294System.Windows.TriggerBase, 294TriggerBase classes, 294Trigger.Setters collection, 294
Triggers property, 286TryFindResource() method, 275TryParse() method, 606Tunneling events
firing sequence, 116naming, 116
Tweak, 465Two-step layout process
ArrangeOverride() method, 543–544MeasureOverride() method, 541–543
TwoWay binding, 580txtMinPrice text box, 657TypeArguments attribute, 764TypeNameAnimation, 393TypeNameAnimationBase class, 394TypeNameAnimation classes, 394TypeNameAnimationUsingKeyFrames class, 394TypeNameAnimationUsingPath class, 394Typography property, 148, 888
■ INDEX
1074
■ UUIElement.CacheMode property, 337UIElement class, 341, 885UIElement3D class, 871UIElement.OnRender() method, 154Underline element, 896Undo command, 517Uniform property, 827UniformToFill property, 827UnitCost property, 612UnitsInStock property, 612UnloadedBehavior property, 819, 820Unlock() method, 390UnmanagedMemoryStream object, 215UpdateSourceTrigger.Explicit mode, 237UpdateSourceTrigger property, 235UpDirection property, 868UpperLatin value, 891UpperRoman value, 891use PushOpacity() method, 371User Account Control (UAC), 211–212UserControl class, 507UserControl.Name property, 515
■ VValidate() method, 593ValidateValueCallback, 99Validation, data binding
catching invalid values, 579–580custom rules
Binding.ValidationRules collection, 586Decimal.Parse() method, 586ErrorContent property, 586ExceptionValidationRule, 587IsValid property, 586minimum and maximum decimal values,
585–586NumberStyles enumeration, 586pattern-based text data, 587PositivePriceRule, 586, 587System.Text.RegularExpressions.Regex class,
587UpdateSourceTrigger property, 586Validate() method, 585ValidationResult object, 586
data objectdisadvantage, 581ExceptionValidationRule, 580, 581
INotifyDataError Interface (seeINotifyDataError interface)
Product.UnitPrice property, 580StoreDB and Product classes, 581UnitsInStock, 581
different error indicatorAdornedElementPlaceholder, 590adorner layer, 589error templates, 589–591TextBox control, 591validation error message, 592Validation.Errors property, 591Validation.HasError, 591
error reaction, 587–588list of errors, 588–589multiple values
BindingGroup.CommitEdit() method, 594,595
BindingGroup.GetValue() method, 593BindingGroup.Items collection, 593BindingGroup.Name property, 593binding groups, 592DataContext set, 592DataGrid control, 595event handling code, 594GetValue() method, 594Grid.DataContext property, 592item-level validation, 592, 594NoBlankProductRule, 592, 593Validate() method, 593Validation.ErrorTemplate, 594
OneWayToSource binding, 580TwoWay binding, 580
ValidationError.ErrorContent property, 588ValidationErrorEventArgs.Error property, 587ValidationError object, 587Validation.ErrorTemplate property, 581Validation.HasError property, 581ValueChanged event, 826ValueConversion attribute, 606Value converter class, 605Value converters, 603
background color change, 605Binding.StringFormat property, 605data formatting, 605data templates, 632Format and Parse binding events, 605object creation
Binding.DoNothing value, 610BitmapImage class, 609BitmapImage object, 608, 610
1075
■ INDEX
byte array, 608ConvertBack() method, 610Convert() method, 610displaying bound images, 609ImageDirectory, 608ImageDirectory property, 609ImagePathConverter, 608–609ImagePathConverter class, 609ImageSource object, 610Image.Source property, 609OpenFileDialog class, 610ProductImage field, 608StreamSource property, 608System.Windows.Forms.Binding class, 608System.Windows.Media.Imaging.
BitmapImage object, 608string formatting
Binding.StringFormat property, 605creation, 606DataBinding namespace, 607Decimal.ToString() method, 606Parse() method, 606PriceConverter class, 607Product.UnitCost property, 606Resources collection, 607StaticResource reference, 607System.Globalization.NumberStyles value,
606ToString() method, 606TryParse() method, 606XML namespace prefix, 607
WPF object creation, 605ValueInStockConverter, 612vbproj .csproj file, 768VerifyAccess() method, 985VerticalAlignment property, 58, 156, 544VerticalAnchor property, 901VerticalContentAlignment property, 156VerticalOffset property, 901VerticalScrollBarVisibility property, 179, 778Video
effectsClipping property, 828content control, 827copying content, 828intermediary rendering surface, 830LayoutTransform property, 828Opacity property, 828reflection effect, 828–829RenderTransform property, 828resolutions and frame rates, 830
VideoDrawing class, 830playing, 827
VideoDrawing class, 830Viewbox property, 332Viewbox.Stretch property, 315View object
CollectionView, 647creation, 651–653navigation
brute-force approach, 651ComboBox, 651CurrentChanged event, 650CurrentItem, 648CurrentPosition, 648data binding and triggers, 650DataContext, 649ICollectionView interface, 649ItemsControl.
IsSynchronizedWithCurrentItem, 651ItemsSource property, 651lookup list, 651ModelName property, 651previous and next buttons code, 650record browser with drop-down list, 650reference storage, 649
ObservableCollection class, 648retrieval, 648
Viewport3D class, 838Viewport property, 333, 872–873ViewportUnits property, 333Virtualization, 663VirtualizingStackPanel, 577–579, 642VirtualizingStackPanel.
IsVirtualizingWhenGrouping property, 663VirtualizingStackPanel.ScrollUnit property, 579Virtual trackball, 870–871Visibility property, 91, 125VisualBrush class, 325, 335–336, 345, 346, 828, 830,
864–865, 876VisualChildrenCount property, 372Visual3D class, 396, 839Visual layer, 308Visuals
complex compound shapes, 369complex hit testing, 377–380draw, 370–371hit testing, 375–377layer model, 370wrapping, 372–375
VisualStateGroups element, 534VisualStateGroup.Transitions collection, 535
■ INDEX
1076
VisualStateManager element, 534, 536VisualStateManager.VisualStateGroups element,
533Visual states model, 503–504Visual Studio data source, 575VisualTransition element, 536VisualTransition.GeneratedDuration property, 536VisualTreeHelper class, 377VisualTreeHelper.HitTest() method, 375, 377, 871VRoutedEventArgs class, 107
■ WWAV audio
SoundPlayerAction class, 815SoundPlayer class, 813–815system sounds, 816
WebBrowser control, 747DOM tree, 781–785HTML web page, 779page navigation, 780–781scripting with .NET code, 784–786vs. Frame, 780web-style navigation, 779
WebBrowser.Document property, 782WebBrowser element, 341WebBrowser.LoadCompleted event, 782WebBrowser.NavigateToString() method, 786WebBrowser.ObjectForScripting property, 784WebClick() method, 785, 786Width property, 59, 62, 901Window class, 707
Close() and Hide() method, 710properties, 707–708ShowDialog() method, 709Show() method, 709
WindowHeight property, 745Window.Owner property, 205Window.Resources collection, 821, 989Windows, 707
built-in dialog boxes, 716–717custom control template, 725
AdornerDecorator element, 725basic structure, 725Border object, Grids, 726code-behind approach, 728problems, 727window border and background, 727
dialog model, 715–716interaction
DoUpdate() method, 713
MainWindow and Windows properties, 713one-to-many, 714
ownership, 715positioning, 710–711saving and restoring location, 711–713shaped window
background image, 718basic techniques, 717border, 719Grid, 720nontransparent content, 718transparent background, 721–722with transparent regions, 718Window.DragMove() method, 723Window.ResizeMode property, 723–725
taskbar programming (see Taskbareprogramming)
Windows Communication Foundation (WCF), 207Windows Forms, 392, 793
adding Forms to WPF application, 968adding WPF Windows to Windows Forms
application, 968–969enabling visual styles, 970–971glue code, 968interaction reasons, 967interoperability access, 967–968with mixed content
access keys, mnemonics, and focus, 978–980ActiveX content, 971airspace, 971–973component-specific wrapper, 971interoperability layer, 971property mapping, 980–982System.Windows.Forms.Integration.
ElementHost class, 976–978WindowsFormsHost control, 976–978and WPF user controls, 975–976
modal, 969modeless, 969–970
WindowsFormsApplicationBase, 207, 208WindowsFormsHost class, 980, 981, 982WindowsFormsHost control, 976–978WindowsFormsHost element, 341, 975WindowsFormsHost.
EnableWindowsFormsInterop() method, 970
Windows Forms layout controls, 976Windows Forms toolkit, 968Window.ShowDialog() method, 969Windows Media Player, 816Windows Presentation Foundation (WPF)
1077
■ INDEX
animations, 5architecture
class hierarchy, 12–15Direct3D, 12layers, 11milcore dll, 11PresentationCore.dll, 11User32, 12WindowsBase.dll, 11WindowsCodecs.dll, 12
architecture PresentationFramework.dll, 11audio and video media, 5commands, 5declarative user interface, 5page-based applications, 6resolution independence
bitmap and vector graphics, 10consumer monitors, 6device-independent units, 6, 7DPI setting, 6higher pixel densities, 6monitor resolution, 6system DPI (see System DPI)e
rich drawing model, 5rich text model, 5styles and templates, 5web-like layout model, 5windows graphics
DirectX, 4GDI/GDI+, 3hardware acceleration and WPF, 4User32, 3
WPF 4.5, 15toolkit, 16visual studio 2012, 16, 17
WindowTitle property, 745, 747Window.Unloaded event handler, 817WindowWidth property, 745Win32 interoperability, 982WPF
BeginInit() method, 119controls (see Controls)eConvertToString() method, 124custom elements (see Custom elements)edependency properties (see Dependency e
properties)direct events, definition of, 127drag-and-drop operations, 130EndInit() method, 119focus, 125focusable property, 125
FrameworkElement class and the ISupportInitialize interface, 119
handling a key press, 122hiding or disabling a control, 125HwndSource property, 120InitializeComponent() method, 120initialized event, 119InnerException property, 120InputDevice class, 121input events, 118, 120IsEnabled property, 125IsInitialized property, 119IsLoaded property, 119IsRepeat property, 123IsTabStop property, 125Keyboard class, 126KeyboardDevice class, 126KeyboardDevice methods, table of, 126KeyboardDevice property, 126keyboard events, 118, 121KeyDown event, 123KeyEventArgs object, 123, 126Key property, 123KeyStates property, 126lifetime events, 118loaded event, 119LostFocus event, 120modifier keys, checking the status of, 126mouse click events, 128mouse coordinates, 127MouseEventArgs object, 127mouse events, 118MouseMove event, 127multithreading (see Multithreading)ePasswordBox class, 506PreviewKeyDown event, 124PreviewMouseMove event, 127PreviewTextInput event, 123, 124rendering process for events, 119stylus events, 118TabIndex property, setting, 125TextBox class, 505TextBox control and the TextInput event, 122TextCompositionEventArgs object, 123TextInput event, 123ToString() method, 124using the KeyConverter, 124virtual key state, 126visibility property, 125writing validation logic in a PreviewKeyDown
event handler, 124
■ INDEX
1078
WPF (cont.)ttXamlParseException object, 120
WPF 4.5, 787WPF application
accessing current application, 204assembly resources (see Assembly resources)ehandling command-line arguments, 202–204life cycle
App.g.cs file, 197App.xaml.cs file, 198object creation, 195–196shutdown, 198–199StartupUri property, 197TestApplication.App., 197Visual Studio derives, 197XAML document, 198XBAPs, 195
localization (see Localization)esingle-instance (see Single-instance application)eSplash Screen, 202System.Windows.Application class, 195windows interation, 205–207
WPF’s 2-D drawing model, 368WPF visuals. See VisualseWrapBreakPanel, 545, 547WrapDirection property, 901WrapPanel, 641, 659
ArrangeOverride() method, 547code example for a series of buttons, 66controlling small-scale details controlling, 66default settings, 65FrameworkPropertyMetadata object, 545LineBreakBefore property, 545–547WrapBreakPanel, 545, 547
Wrapping visuals, 372–375WrapWithOverflow, 179WriteableBitmap class
Bgra32 format, 385Bgr32 format, 385black-and-white and grayscale formats, 386colorData array, 386DPI resolution, 385graphical content, 385Image element, 385indexed formats, 386modifiable array pixels, 385Pbgra32, 386PixelFormats, 385pixel writing, 387–390WritePixels() method, 386
WYSIWYG interface, 889
■ X, YXAML browser applications (XBAPs), 195, 751
ClickOnce deployment, 767creation, 768–769deployment, 769–770embedding, web page, 779Firefox, 767full-trust, 772Internet Explorer, 767limited permissions, 767not installed on computer, 767prompt-free experience, 767run inside browser window, 767security
CodeAccessPermission.Demand() method,773
code access security, 771dialog boxes with pop-up control, 776–779FileIOPermission, 774isolated storage, 774–776.NET Framework, 771SecurityException, 772unhandled exception, 772WPF Features and Internet Zone, 771
and stand-alone applications combination, 773updation, 770–771
XAML document, 989XAML format, 915XamlParseException object, 120, 278XamlReader class, 911XamlReader.Load() method, 913, 916XamlWriter class, 912.xbap extension, 768XmlDataProvider, 595, 598–600XML Paper Specification (XPS), 216XmlStreamStore class, 922XPath expressions, 599XPS document, 920, 921XpsDocument class, 920
■ ZZAM 3D modeling, 866Z-fighting, 850z-index, 973ZIndex property, 84Zoom property, 907