内容简介
《Windows 程序设计(第6版 英文版)》系经典图书《Windows程序设计》的第6版,全书为的Windows 8操作系统进行了改写。作者在《Windows 程序设计(第6版 英文版)》中细致地介绍了如何使用现有的C#技能和XAML以及Windows Runtime,创建全屏幕的Windows 8触摸应用程序,内容包括创建和初始化对象、管理和试验动态布局、创建Windows Runtime库、使用MVVM进行数据绑定和控制、使用及编写异步方法、动画过渡和创建2D和3D等,此外书中还介绍了操纵位图和富文本、使用GPS和方向传感器、调用Win32和DirectX函数、启用共享、搜索和打印等应用开发技能。
《Windows 程序设计(第6版 英文版)》适合各个层级的Windows开发爱好者阅读使用。
目录
Contents
PART I ELEMENTALS
Chapter 1 Markup and Code 3
The First Project 3
Graphical Greetings 9
Variations in Text 13
Media As Well 22
The Code Alternatives 23
Images in Code 27
Not Even a Page 29
Chapter 2 XAML Syntax 31
The Gradient Brush in Code 31
Property Element Syntax 34
Content Properties 37
The TextBlock Content Property 41
Sharing Brushes (and Other Resources) 43
Resources Are Shared 47
Exploring Vector Graphics 48
Stretching with Viewbox 58
Styles 60
A Taste of Data Binding 66
Chapter 3 Basic Event Handling 69
The Tapped Event 69
Routed Event Handling 72
Overriding the Handled Setting 78
Input, Alignment, and Backgrounds 80
Size and Orientation Changes 83
Bindings to Run? 87
Timers and Animation 89
Chapter 4 Presentation with Panels 97
The Border Element 97
Rectangle and Ellipse 101
The StackPanel 103
Horizontal Stacks 106
WhatSize with Bindings (and a Converter) 108
The ScrollViewer Solution 112
Layout Weirdness or Normalcy? 118
Making an E-Book 119
Fancier StackPanel Items 122
Deriving from UserControl 124
Creating Windows Runtime Libraries 127
The Wrap Alternative 130
The Canvas and Attached Properties 132
The Z-Index 136
Canvas Weirdness 137
Chapter 5 Control Interaction 139
The Control Difference 139
The Slider for Ranges 141
The Grid 146
Orientation and Aspect Ratios 152
Slider and the Formatted String Converter 154
Tooltips and Conversions 154
Sketching with Sliders 157
The Varieties of Button Experience 159
Defi ning Dependency Properties 167
RadioButton Tags 177
Keyboard Input and TextBox 184
Touch and Thumb 187
Chapter 6 WinRT and MVVM 193
MVVM (Brief and Simplifi ed) 193
Data Binding Notifi cations 194
A View Model for ColorScroll 196
Syntactic Shortcuts 201
The DataContext Property 204
Bindings and TextBox 206
Buttons and MVVM 212
The DelegateCommand Class 213
Chapter 7 Asynchronicity 221
Threads and the User Interface 221
Working with MessageDialog 222
Callbacks as Lambda Functions 228
The Amazing await Operator 229
Cancelling an Asynchronous Operation 231
Approaches to File I/O 233
Application Local Storage 234
File Pickers 234
Bulk Access 235
File Pickers and File I/O 235
Handling Exceptions 240
Consolidating Async Calls 241
Streamlined File I/O 243
Application Lifecycle Issues 245
Your Own Asynchronous Methods 250
Chapter 8 App Bars and Popups 261
Implementing Context Menus 261
The Popup Dialog 265
Application Bars 268
The Application Bar Button Style 271
I