E-Book, Englisch, 550 Seiten
Solis Illustrated WPF
1. ed
ISBN: 978-1-4302-1911-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 550 Seiten
ISBN: 978-1-4302-1911-8
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
Windows Presentation Foundation is Microsoft's API for creating Windows applications. It gives the programmer the ability to produce dazzling, graphics-rich programs easily without having to delve into the messy details of the graphics subsystem. To use this power, however, the programmer must learn new concepts for laying out pages and displaying graphics. Illustrated WPF presents these concepts clearly and visually-making them easier to understand and retain.
Daniel Solis is a contract software engineer who has worked for a number of high-profile clients, including Microsoft Consulting Services, IBM, Lockheed Martin, and PeopleSoft. He has been programming and teaching object-oriented languages and development methods throughout the U.S. and Europe since the early days of C++. It was while teaching numerous seminars on various programming languages that he realized the immense power of diagrams in explaining programming language concepts.
Autoren/Hrsg.
Weitere Infos & Material
1;Content at a Glance;5
2;Table of Contents ;6
3;About the Author;14
4;Acknowledgments;15
5;Introduction;16
5.1;Audience, Source Code, and Contact Information;16
6;1 Introduction to WindowsPresentation Foundation;17
6.1;What Is Windows Presentation Foundation?;18
6.2;The Path to the Screen;19
6.2.1;Games and DirectX;19
6.2.2;Windows Forms;20
6.2.3;Rendering Under WPF;21
6.3;Documents and Fonts;22
6.4;Graphics and Animation;22
6.5;Styles and Control Templates;23
6.6;Separating Visual Design from Coding;23
6.7;WPF Prefers Vector Graphics;24
6.7.1;Bitmap Images;24
6.7.2;Bitmap Images and Screen Size;25
6.7.3;Vector Graphics;26
6.8;System DPI Independence and WPF Units;27
6.9;XAML Browser Applications (XBAPs);29
6.10;The Other Parts of .NET;30
6.11;Silverlight;31
6.12;Summary;32
7;2 Overview of WPF Programming;33
7.1;What Is an API?;34
7.2;A Simple WPF Program;35
7.2.1;Creating the Simple Program;37
7.2.2;Just the Facts;38
7.2.3;Step-by-Step;39
7.3;The Compilation Process;44
7.4;The Application and Window Classes;45
7.5;The Window Class;46
7.5.1;The Components of a Visual Window;46
7.5.2;Creating a Window;47
7.6;Important Properties of a Window;49
7.6.1;WindowStyle;50
7.6.2;Content;51
7.7;Summary;53
8;3 WPF Architecture and Applications;54
8.1;Using Visual Studio to Create a WPF Program;55
8.1.1;Source Code Generated by the Template;59
8.2;What Is XAML?;60
8.2.1;Logical Trees and Visual Trees;61
8.3;The Compilation Process;62
8.3.1;How the Files Are Used;64
8.4;The WPF Architecture;66
8.5;More About the Window Class;67
8.5.1;SolidColorBrushes;68
8.5.1.1;Creating Colors;70
8.5.2;Gradient Brushes;74
8.5.2.1;Linear Gradient Brushes;75
8.5.2.2;RadialGradientBrushes;77
8.6;The Application Class;78
8.7;Handling Application Events;79
8.7.1;Application Lifetime Events;79
8.8;UI Elements Contain Content;82
8.9;The Class Inheritance Hierarchy;83
8.10;Summary;85
9;4 XAML;86
9.1;A Tree of Objects;87
9.1.1;Using XamlPad;88
9.2;Creating the UI Structure;89
9.3;XAML Trees;91
9.4;Object Element Syntax;91
9.4.1;The Syntax of Elements;92
9.5;Attribute Syntax;93
9.5.1;Empty Elements;94
9.6;More About Object Element Syntax;95
9.6.1;The Default Content Property;96
9.7;Type Converters for Attributes;97
9.8;Property Element Syntax;98
9.9;Attached Property Syntax;99
9.9.1;Reviewing the XAML Syntax Forms;100
9.9.2;Top-Level Elements;100
9.10;Code-Behind and Object Names;101
9.11;Namespaces;102
9.11.1;The Syntax of Namespaces;103
9.11.2;Using Classes from Other Namespaces;105
9.11.3;Example Using Namespaces;107
9.12;Markup Extensions;108
9.12.1;Example Creating a Markup Extension;110
9.13;White Space;112
9.14;Special Characters;114
9.15;Summary;115
10;5 Layout;116
10.1;Layout in WPF;117
10.2;Chapter Conventions;118
10.3;The Layout Process;119
10.4;Setting the Requested Size of Elements;121
10.5;Alignment;122
10.6;Content Alignment;123
10.7;Visibility;124
10.8;Padding and Margins;125
10.9;Panels;127
10.10;The StackPanel;128
10.11;The WrapPanel;129
10.12;The DockPanel;131
10.13;The Grid;134
10.13.1;Items Spanning Cells;137
10.13.2;Sizing Rows and Columns;139
10.13.2.1;Absolute Sizing;139
10.13.2.2;Automatic Sizing;141
10.13.2.3;Proportional Sizing;142
10.13.3;Splitter Bars;144
10.13.4;Shared Size Groups;147
10.14;The Canvas;149
10.14.1;Z-Order on a Canvas;151
10.15;The UniformGrid;153
10.16;Summary;154
11;6 Content and Controls;155
11.1;Liberating Content;156
11.2;Source Code Conventions;157
11.3;The Image Element;158
11.3.1;Displaying an Image Using Code;159
11.4;The ContentControls;161
11.4.1;The Label Control;162
11.4.2;The Button Control;164
11.4.3;The CheckBox and RadioButton Controls;165
11.4.3.1;Grouping RadioButtons;166
11.4.4;The ScrollViewer;173
11.5;The Window Class;167
11.5.1;Window Ownership;168
11.5.2;Modal Dialog Boxes;169
11.5.3;The MessageBox Dialog Box;172
11.6;The HeaderedContentControls;174
11.6.1;The GroupBox Element;175
11.6.2;The Expander Control;176
11.7;ItemsControl Elements;177
11.7.1;The ListBox Control;178
11.7.1.1;Checking the Selection;179
11.7.1.2;Notification of Changed Selection;180
11.7.2;Multiple Selections;181
11.7.3;The ComboBox Control;182
11.7.3.1;Selecting and Entering Items;183
11.8;Summary;184
12;7 Dependency Properties;185
12.1;Properties and a New Paradigm;186
12.2;Looking at an Example;188
12.3;Determining the Value of a Property;190
12.4;The Infrastructure of a Dependency Property;191
12.5;Creating a Custom Dependency Property;192
12.6;Example: Creating a Dependency Property;198
12.7;Attached Properties;201
12.8;The Structure of an Attached Property;203
12.9;Creating an Attached Property;204
12.10;Summary;207
13;8 Data Binding;208
13.1;What Is Data Binding?;209
13.2;The Binding Object;211
13.3;Binding Direction;213
13.4;Triggers;215
13.5;Data Converters;217
13.6;Multiple Bindings on an Element;219
13.7;More Fun with Multiple Bindings;220
13.8;Deleting Bindings;222
13.9;Binding to Nonelements;225
13.10;Data Contexts;227
13.11;Bindings and ItemsControls;228
13.12;Summary;232
14;9 Routing Events and Commands;233
14.1;What Is an Event?;234
14.2;Event Handlers: Syntax and Semantics;236
14.3;What Are Routed Events?;237
14.3.1;Handling Routed Events;238
14.3.2;Bubbling Example;239
14.3.3;Checking for Tunneling;241
14.4;Commands;243
14.5;Built-in Commands and Support;246
14.6;The RoutedCommand Class;251
14.7;Creating Custom Commands;252
14.7.1;Routing Commands;255
14.8;Summary;256
15;10 Other Controls and Elements;257
15.1;The TextBox Control;258
15.2;Menus;260
15.2.1;Adorning the MenuItem;262
15.2.2;Other Content As the Menu Header;263
15.2.3;Attaching Commands to Menu Items;264
15.3;Context Menus;266
15.4;ToolBars;268
15.5;StatusBars;270
15.6;ToolTips;271
15.7;Controls That Work with Ranges;272
15.7.1;The ProgressBar;272
15.7.2;The Slider;275
15.8;Summary;277
16;11 Resources;278
16.1;Two Types of Resources;279
16.2;The ResourceDictionary;280
16.2.1;StaticResources and DynamicResources;288
16.3;Assembly Resources;292
16.4;Accessing Assembly Resources from the Code;293
16.4.1;Pack URIs;295
16.5;Summary;297
17;12 Styles;298
17.1;What Are Styles?;299
17.2;Named Styles;300
17.3;Targeted Styles;303
17.4;Comparing Named and Targeted Styles;304
17.5;EventSetters;305
17.6;The Collections in a Style;306
17.7;Property Triggers;307
17.8;MultiTriggers;308
17.9;Other Types of Triggers;309
17.10;Summary;310
18;13 Control Templates;311
18.1;Separating Appearance from Behavior;312
18.2;Developing a Simple Control Template;314
18.3;The ContentPresenter Class;316
18.4;Template Binding;318
18.5;ControlTemplate Triggers;319
18.6;Summary;322
19;14 Page Navigation Programs;323
19.1;Types of Navigation;324
19.1.1;The Components of a Navigation Program;328
19.1.2;Frames;331
19.1.3;Journal Options in Frames;333
19.2;Navigating Programmatically;334
19.2.1;Passing Data to a Page;336
19.2.2;Getting Data Back from a Page;339
19.3;XAML Browser Applications;343
19.3.1;Creating an XBAP Application;343
19.3.1.1;Deploying and Running;344
19.4;Summary;346
20;15 More Data Binding;347
20.1;Data Templates;348
20.2;Views;356
20.3;Filtering in a View;357
20.4;Sorting in a View;361
20.5;Grouping in a View;364
20.6;Summary;368
21;16 Trees, Tabs, and Other Controls;369
21.1;The TreeView Control;370
21.2;The HierarchicalDataTemplate;374
21.3;Using Event Handlers with TreeViews;380
21.4;Binding Other Controls to a TreeView;383
21.5;The TabControl;386
21.6;The Calendar Control;388
21.7;The DatePicker Control;391
21.8;Summary;397
22;17 Text and Documents;398
22.1;Text in WPF;399
22.2;An Overview of Flow Documents;400
22.3;The Components of a Flow Document;403
22.3.1;The Hosting Controls;404
22.4;The Content of a Flow Document;405
22.4.1;Tables and Lists;411
22.5;Embedded Flow Documents;415
22.6;The TextBlock Element;416
22.7;Summary;419
23;18 Graphics in WPF;420
23.1;Graphics in WPF;421
23.2;Transforms;422
23.2.1;The RotateTransform;423
23.2.2;Using LayoutTransform vs. RenderTransform;425
23.2.3;The TranslateTransform;427
23.2.4;The SkewTransform;428
23.2.5;The ScaleTransform;430
23.3;BitmapEffects;431
23.4;Brushes;433
23.4.1;LinearGradientBrushes;434
23.5;Shapes;438
23.6;The Geometry Classes;440
23.6.1;The Simple Geometry Classes;441
23.6.2;The PathGeometry Class;443
23.6.2.1;The LineSegment and the PolyLineSegment;445
23.6.2.2;The ArcSegment;446
23.6.2.3;Combining Geometries;448
23.6.2.4;Path Markup Syntax;450
23.6.3;Filling Geometries;452
23.7;Drawings;455
23.7.1;The DrawingImage Class;457
23.7.2;The DrawingBrush Class;458
23.8;Summary;460
24;19 Animation;461
24.1;What Is Animation?;462
24.2;Animation Object Basics;464
24.3;The AnimationClock Class;468
24.4;Storyboards;470
24.4.1;Storyboards in Markup;474
24.5;Other Variations on Animation;476
24.6;Keyframe Animations;477
24.6.1;Linear Keyframe Animation;478
24.6.2;Spline Interpolation Animations;481
24.6.3;Discrete Keyframe Animation;483
24.7;Path Animations;484
24.8;Summary;486
25;20 Audio and Video;487
25.1;Overview of Audio;488
25.1.1;SystemSounds;488
25.2;SoundPlayer;489
25.2.1;SoundPlayerAction;490
25.3;MediaPlayer;491
25.4;MediaElement;494
25.5;Video;499
25.6;Summary;501
26;Index;502




