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