upload/misc/IXKXcI5mZnjhFnLAUPaa/E-Books/computer/windows/9780735671768_programming_windows_a11a.pdf
Programming Windows: Writing Windows 8 Apps With C# and XAML (Developer Reference) 🔍
Charles Petzold
Microsoft Press, 6th ed, Redmond, Wash, ©2013
English [en] · PDF · 23.9MB · 2013 · 📘 Book (non-fiction) · 🚀/lgli/lgrs/nexusstc/upload/zlib · Save
description
Cover 1
Copyright page 2
Contents at a Glance 3
Table of Contents 5
Introduction 15
The Versions of Windows 8 15
The Focus of This Book 17
The Approach 19
Source Code 20
My Setup 20
The Programming Windows Heritage 21
More in the Future 24
Behind the Scenes 25
Errata & Book Support 25
We Want to Hear from You 26
Stay in Touch 26
Part I: Elementals 27
Chapter 1: Markup and Code 29
The First Project 29
Graphical Greetings 35
Variations in Text 39
Media As Well 48
The Code Alternatives 49
Images in Code 53
Not Even a Page 55
Chapter 2: XAML Syntax 57
The Gradient Brush in Code 57
Property-Element Syntax 60
Content Properties 63
The TextBlock Content Property 67
Sharing Brushes (and Other Resources) 69
Resources Are Shared 73
Exploring Vector Graphics 74
Stretching with Viewbox 84
Styles 86
A Taste of Data Binding 92
Chapter 3: Basic Event Handling 95
The Tapped Event 95
Routed Event Handling 98
Overriding the Handled Setting 104
Input, Alignment, and Backgrounds 106
Size and Orientation Changes 109
Bindings to Run? 113
Timers and Animation 115
Chapter 4: Presentation with Panels 123
The Border Element 123
Rectangle and Ellipse 127
The StackPanel 129
Horizontal Stacks 132
WhatSize with Bindings (and a Converter) 134
The ScrollViewer Solution 138
Layout Weirdness or Normalcy? 144
Making an E-Book 145
Fancier StackPanel Items 148
Deriving from UserControl 150
Creating Windows Runtime Libraries 153
The Wrap Alternative 156
The Canvas and Attached Properties 158
The Z-Index 162
Canvas Weirdness 163
Chapter 5: Control Interaction 165
The Control Difference 165
The Slider for Ranges 167
The Grid 172
Orientation and Aspect Ratios 178
Slider and the Formatted String Converter 180
Tooltips and Conversions 180
Sketching with Sliders 183
The Varieties of Button Experience 185
Defining Dependency Properties 193
RadioButton Tags 203
Keyboard Input and TextBox 210
Touch and Thumb 213
Chapter 6: WinRT and MVVM 219
MVVM (Brief and Simplified) 219
Data Binding Notifications 220
A View Model for ColorScroll 222
Syntactic Shortcuts 227
The DataContext Property 230
Bindings and TextBox 232
Buttons and MVVM 238
The DelegateCommand Class 239
Chapter 7: Asynchronicity 247
Threads and the User Interface 247
Working with MessageDialog 248
Callbacks as Lambda Functions 254
The Amazing await Operator 255
Cancelling an Asynchronous Operation 257
Approaches to File I/O 259
Application Local Storage 260
File Pickers 260
Bulk Access 261
File Pickers and File I/O 261
Handling Exceptions 266
Consolidating Async Calls 267
Streamlined File I/O 269
Application Lifecycle Issues 271
Your Own Asynchronous Methods 276
Chapter 8: App Bars and Popups 287
Implementing Context Menus 287
The Popup Dialog 291
Application Bars 294
The Application Bar Button Style 297
Inside the Segoe UI Symbol Font 302
App Bar CheckBox and RadioButton 309
An App Bar for a Note Pad 312
Introducing XamlCruncher 319
Application Settings and View Models 334
The XamlCruncher Page 337
Parsing the XAML 342
XAML Files In and Out 344
The Settings Dialog 348
Beyond the Windows Runtime 353
Chapter 9: Animation 355
The Windows.UI.Xaml.Media.Animation Namespace 355
Animation Basics 356
Animation Variation Appreciation 360
Other Double Animations 366
Animating Attached Properties 373
The Easing Functions 376
All-XAML Animations 385
Animating Custom Classes 390
Key Frame Animations 393
The Object Animation 397
Predefined Animations and Transitions 399
Chapter 10: Transforms 403
A Brief Overview 403
Rotation (Manual and Animated) 406
Visual Feedback 412
Translation 414
Transform Groups 417
The Scale Transform 422
Building an Analog Clock 426
Skew 432
Making an Entrance 435
Transform Mathematics 436
The Composite Transform 444
Geometry Transforms 447
Brush Transforms 448
Dude, Where’s My Element? 453
Projection Transforms 456
Deriving a Matrix3D 463
Chapter 11: The Three Templates 475
Data in a Button 476
Making Decisions 486
Collection Controls and the Real Use of DataTemplate 489
Collections and Interfaces 500
Tapping and Selecting 501
Panels and Virtualizing Panels 507
Custom Panels 510
The Item Template Bar Chart 523
The FlipView Control 526
The Basic Control Template 528
The Visual State Manager 539
Using generic.xaml 546
Template Parts 547
Custom Controls 556
Templates and Item Containers 561
Chapter 12: Pages and Navigation 565
Screen Resolution Issues 565
Scaling Issues 571
Snap Views 575
Orientation Changes 580
Simple Page Navigation 583
The Back Stack 588
Navigation Events and Page Restoration 590
Saving and Restoring Application State 594
Navigational Accelerators and Mouse Buttons 598
Passing and Returning Data 601
Visual Studio Standard Templates 607
View Models and Collections 614
Grouping the Items 634
Part II: Specialties 639
Chapter 13: Touch, Etc. 641
A Pointer Roadmap 642
A First Dab at Finger Painting 645
Capturing the Pointer 648
Editing with a Popup Menu 656
Pressure Sensitivity 659
Smoothing the Tapers 663
How Do I Save My Drawings? 672
Real and Surreal Finger Painting 673
A Touch Piano 675
Manipulation, Fingers, and Elements 681
Working with Inertia 689
An XYSlider Control 693
Centered Scaling and Rotation 699
Single-Finger Rotation 702
Chapter 14: Bitmaps 709
Pixel Bits 710
Transparency and Premultiplied Alphas 717
A Radial Gradient Brush 722
Loading and Saving Image Files 729
Posterize and Monochromize 740
Saving Finger Paint Artwork 748
HSL Color Selection 773
Reverse Painting 784
Accessing the Pictures Library 789
Capturing Camera Photos 798
Chapter 15: Going Native 805
An Introduction to P/Invoke 806
Some Help 812
Time Zone Information 812
A Windows Runtime Component Wrapper for DirectX 834
DirectWrite and Fonts 835
Configurations and Platforms 847
Interpreting Font Metrics 850
Drawing on a SurfaceImageSource 857
Chapter 16: Rich Text 871
Private Fonts 873
A Taste of Glyphs 876
Font Files in Local Storage 878
Typographical Enhancements 882
RichTextBlock and Paragraphs 884
RichTextBlock Selection 888
RichTextBlock and Overflow 888
The Perils of Pagination 896
Rich Editing with RichEditBox 903
Your Own Text Input 913
Chapter 17: Share and Print 919
Settings and Popups 920
Sharing Through the Clipboard 924
The Share Charm 929
Basic Printing 930
Printable and Unprintable Margins 937
The Pagination Process 940
Custom Printing Properties 948
Printing a Monthly Planner 954
Printing a Range of Pages 963
Where to Do the Big Jobs? 974
Printing FingerPaint Art 974
Chapter 18: Sensors and GPS 979
Orientation and Orientation 979
Acceleration, Force, Gravity, and Vectors 984
Follow the Rolling Ball 995
The Two Norths 999
Inclinometer = Accelerometer + Compass 1002
OrientationSensor = Accelerometer + Compass 1006
Azimuth and Altitude 1012
Bing Maps and Bing Map Tiles 1025
Chapter 19: Pen (Also Known as Stylus) 1039
The InkManager Collections 1040
The Ink Drawing Attributes 1043
Erasing and Other Enhancements 1049
Selecting Strokes 1055
The Yellow Pad 1064
Index 1083
About the Author 1135
Survey page 1136
Cover 1
Copyright page 2
Contents at a Glance 3
Table of Contents 5
Introduction 15
The Versions of Windows 8 15
The Focus of This Book 17
The Approach 19
Source Code 20
My Setup 20
The Programming Windows Heritage 21
More in the Future 24
Behind the Scenes 25
Errata & Book Support 25
We Want to Hear from You 26
Stay in Touch 26
Part I: Elementals 27
Chapter 1: Markup and Code 29
The First Project 29
Graphical Greetings 35
Variations in Text 39
Media As Well 48
The Code Alternatives 49
Images in Code 53
Not Even a Page 55
Chapter 2: XAML Syntax 57
The Gradient Brush in Code 57
Property-Element Syntax 60
Content Properties 63
The TextBlock Content Property 67
Sharing Brushes (and Other Resources) 69
Resources Are Shared 73
Exploring Vector Graphics 74
Stretching with Viewbox 84
Styles 86
A Taste of Data Binding 92
Chapter 3: Basic Event Handling 95
The Tapped Event 95
Routed Event Handling 98
Overriding the Handled Setting 104
Input, Alignment, and Backgrounds 106
Size and Orientation Changes 109
Bindings to Run? 113
Timers and Animation 115
Chapter 4: Presentation with Panels 123
The Border Element 123
Rectangle and Ellipse 127
The StackPanel 129
Horizontal Stacks 132
WhatSize with Bindings (and a Converter) 134
The ScrollViewer Solution 138
Layout Weirdness or Normalcy? 144
Making an E-Book 145
Fancier StackPanel Items 148
Deriving from UserControl 150
Creating Windows Runtime Libraries 153
The Wrap Alternative 156
The Canvas and Attached Properties 158
The Z-Index 162
Canvas Weirdness 163
Chapter 5: Control Interaction 165
The Control Difference 165
The Slider for Ranges 167
The Grid 172
Orientation and Aspect Ratios 178
Slider and the Formatted String Converter 180
Tooltips and Conversions 180
Sketching with Sliders 183
The Varieties of Button Experience 185
Defining Dependency Properties 193
RadioButton Tags 203
Keyboard Input and TextBox 210
Touch and Thumb 213
Chapter 6: WinRT and MVVM 219
MVVM (Brief and Simplified) 219
Data Binding Notifications 220
A View Model for ColorScroll 222
Syntactic Shortcuts 227
The DataContext Property 230
Bindings and TextBox 232
Buttons and MVVM 238
The DelegateCommand Class 239
Chapter 7: Asynchronicity 247
Threads and the User Interface 247
Working with MessageDialog 248
Callbacks as Lambda Functions 254
The Amazing await Operator 255
Cancelling an Asynchronous Operation 257
Approaches to File I/O 259
Application Local Storage 260
File Pickers 260
Bulk Access 261
File Pickers and File I/O 261
Handling Exceptions 266
Consolidating Async Calls 267
Streamlined File I/O 269
Application Lifecycle Issues 271
Your Own Asynchronous Methods 276
Chapter 8: App Bars and Popups 287
Implementing Context Menus 287
The Popup Dialog 291
Application Bars 294
The Application Bar Button Style 297
Inside the Segoe UI Symbol Font 302
App Bar CheckBox and RadioButton 309
An App Bar for a Note Pad 312
Introducing XamlCruncher 319
Application Settings and View Models 334
The XamlCruncher Page 337
Parsing the XAML 342
XAML Files In and Out 344
The Settings Dialog 348
Beyond the Windows Runtime 353
Chapter 9: Animation 355
The Windows.UI.Xaml.Media.Animation Namespace 355
Animation Basics 356
Animation Variation Appreciation 360
Other Double Animations 366
Animating Attached Properties 373
The Easing Functions 376
All-XAML Animations 385
Animating Custom Classes 390
Key Frame Animations 393
The Object Animation 397
Predefined Animations and Transitions 399
Chapter 10: Transforms 403
A Brief Overview 403
Rotation (Manual and Animated) 406
Visual Feedback 412
Translation 414
Transform Groups 417
The Scale Transform 422
Building an Analog Clock 426
Skew 432
Making an Entrance 435
Transform Mathematics 436
The Composite Transform 444
Geometry Transforms 447
Brush Transforms 448
Dude, Where鈥檚 My Element? 453
Projection Transforms 456
Deriving a Matrix3D 463
Chapter 11: The Three Templates 475
Data in a Button 476
Making Decisions 486
Collection Controls and the Real Use of DataTemplate 489
Collections and Interfaces 500
Tapping and Selecting 501
Panels and Virtualizing Panels 507
Custom Panels 510
The Item Template Bar Chart 523
The FlipView Control 526
The Basic Control Template 528
The Visual State Manager 539
Using generic.xaml 546
Template Parts 547
Custom Controls 556
Templates and Item Containers 561
Chapter 12: Pages and Navigation 565
Screen Resolution Issues 565
Scaling Issues 571
Snap Views 575
Orientation Changes 580
Simple Page Navigation 583
The Back Stack 588
Navigation Events and Page Restoration 590
Saving and Restoring Application State 594
Navigational Accelerators and Mouse Buttons 598
Passing and Returning Data 601
Visual Studio Standard Templates 607
View Models and Collections 614
Grouping the Items 634
Part II: Specialties 639
Chapter 13: Touch, Etc. 641
A Pointer Roadmap 642
A First Dab at Finger Painting 645
Capturing the Pointer 648
Editing with a Popup Menu 656
Pressure Sensitivity 659
Smoothing the Tapers 663
How Do I Save My Drawings? 672
Real and Surreal Finger Painting 673
A Touch Piano 675
Manipulation, Fingers, and Elements 681
Working with Inertia 689
An XYSlider Control 693
Centered Scaling and Rotation 699
Single-Finger Rotation 702
Chapter 14: Bitmaps 709
Pixel Bits 710
Transparency and Premultiplied Alphas 717
A Radial Gradient Brush 722
Loading and Saving Image Files 729
Posterize and Monochromize 740
Saving Finger Paint Artwork 748
HSL Color Selection 773
Reverse Painting 784
Accessing the Pictures Library 789
Capturing Camera Photos 798
Chapter 15: Going Native 805
An Introduction to P/Invoke 806
Some Help 812
Time Zone Information 812
A Windows Runtime Component Wrapper for DirectX 834
DirectWrite and Fonts 835
Configurations and Platforms 847
Interpreting Font Metrics 850
Drawing on a SurfaceImageSource 857
Chapter 16: Rich Text 871
Private Fonts 873
A Taste of Glyphs 876
Font Files in Local Storage 878
Typographical Enhancements 882
RichTextBlock and Paragraphs 884
RichTextBlock Selection 888
RichTextBlock and Overflow 888
The Perils of Pagination 896
Rich Editing with RichEditBox 903
Your Own Text Input 913
Chapter 17: Share and Print 919
Settings and Popups 920
Sharing Through the Clipboard 924
The Share Charm 929
Basic Printing 930
Printable and Unprintable Margins 937
The Pagination Process 940
Custom Printing Properties 948
Printing a Monthly Planner 954
Printing a Range of Pages 963
Where to Do the Big Jobs? 974
Printing FingerPaint Art 974
Chapter 18: Sensors and GPS 979
Orientation and Orientation 979
Acceleration, Force, Gravity, and Vectors 984
Follow the Rolling Ball 995
The Two Norths 999
Inclinometer = Accelerometer + Compass 1002
OrientationSensor = Accelerometer + Compass 1006
Azimuth and Altitude 1012
Bing Maps and Bing Map Tiles 1025
Chapter 19: Pen (Also Known as Stylus) 1039
The InkManager Collections 1040
The Ink Drawing Attributes 1043
Erasing and Other Enhancements 1049
Selecting Strokes 1055
The Yellow Pad 1064
Index 1083
About the Author 1135
Survey page 1136 (as-gbk-encoding)
Copyright page 2
Contents at a Glance 3
Table of Contents 5
Introduction 15
The Versions of Windows 8 15
The Focus of This Book 17
The Approach 19
Source Code 20
My Setup 20
The Programming Windows Heritage 21
More in the Future 24
Behind the Scenes 25
Errata & Book Support 25
We Want to Hear from You 26
Stay in Touch 26
Part I: Elementals 27
Chapter 1: Markup and Code 29
The First Project 29
Graphical Greetings 35
Variations in Text 39
Media As Well 48
The Code Alternatives 49
Images in Code 53
Not Even a Page 55
Chapter 2: XAML Syntax 57
The Gradient Brush in Code 57
Property-Element Syntax 60
Content Properties 63
The TextBlock Content Property 67
Sharing Brushes (and Other Resources) 69
Resources Are Shared 73
Exploring Vector Graphics 74
Stretching with Viewbox 84
Styles 86
A Taste of Data Binding 92
Chapter 3: Basic Event Handling 95
The Tapped Event 95
Routed Event Handling 98
Overriding the Handled Setting 104
Input, Alignment, and Backgrounds 106
Size and Orientation Changes 109
Bindings to Run? 113
Timers and Animation 115
Chapter 4: Presentation with Panels 123
The Border Element 123
Rectangle and Ellipse 127
The StackPanel 129
Horizontal Stacks 132
WhatSize with Bindings (and a Converter) 134
The ScrollViewer Solution 138
Layout Weirdness or Normalcy? 144
Making an E-Book 145
Fancier StackPanel Items 148
Deriving from UserControl 150
Creating Windows Runtime Libraries 153
The Wrap Alternative 156
The Canvas and Attached Properties 158
The Z-Index 162
Canvas Weirdness 163
Chapter 5: Control Interaction 165
The Control Difference 165
The Slider for Ranges 167
The Grid 172
Orientation and Aspect Ratios 178
Slider and the Formatted String Converter 180
Tooltips and Conversions 180
Sketching with Sliders 183
The Varieties of Button Experience 185
Defining Dependency Properties 193
RadioButton Tags 203
Keyboard Input and TextBox 210
Touch and Thumb 213
Chapter 6: WinRT and MVVM 219
MVVM (Brief and Simplified) 219
Data Binding Notifications 220
A View Model for ColorScroll 222
Syntactic Shortcuts 227
The DataContext Property 230
Bindings and TextBox 232
Buttons and MVVM 238
The DelegateCommand Class 239
Chapter 7: Asynchronicity 247
Threads and the User Interface 247
Working with MessageDialog 248
Callbacks as Lambda Functions 254
The Amazing await Operator 255
Cancelling an Asynchronous Operation 257
Approaches to File I/O 259
Application Local Storage 260
File Pickers 260
Bulk Access 261
File Pickers and File I/O 261
Handling Exceptions 266
Consolidating Async Calls 267
Streamlined File I/O 269
Application Lifecycle Issues 271
Your Own Asynchronous Methods 276
Chapter 8: App Bars and Popups 287
Implementing Context Menus 287
The Popup Dialog 291
Application Bars 294
The Application Bar Button Style 297
Inside the Segoe UI Symbol Font 302
App Bar CheckBox and RadioButton 309
An App Bar for a Note Pad 312
Introducing XamlCruncher 319
Application Settings and View Models 334
The XamlCruncher Page 337
Parsing the XAML 342
XAML Files In and Out 344
The Settings Dialog 348
Beyond the Windows Runtime 353
Chapter 9: Animation 355
The Windows.UI.Xaml.Media.Animation Namespace 355
Animation Basics 356
Animation Variation Appreciation 360
Other Double Animations 366
Animating Attached Properties 373
The Easing Functions 376
All-XAML Animations 385
Animating Custom Classes 390
Key Frame Animations 393
The Object Animation 397
Predefined Animations and Transitions 399
Chapter 10: Transforms 403
A Brief Overview 403
Rotation (Manual and Animated) 406
Visual Feedback 412
Translation 414
Transform Groups 417
The Scale Transform 422
Building an Analog Clock 426
Skew 432
Making an Entrance 435
Transform Mathematics 436
The Composite Transform 444
Geometry Transforms 447
Brush Transforms 448
Dude, Where’s My Element? 453
Projection Transforms 456
Deriving a Matrix3D 463
Chapter 11: The Three Templates 475
Data in a Button 476
Making Decisions 486
Collection Controls and the Real Use of DataTemplate 489
Collections and Interfaces 500
Tapping and Selecting 501
Panels and Virtualizing Panels 507
Custom Panels 510
The Item Template Bar Chart 523
The FlipView Control 526
The Basic Control Template 528
The Visual State Manager 539
Using generic.xaml 546
Template Parts 547
Custom Controls 556
Templates and Item Containers 561
Chapter 12: Pages and Navigation 565
Screen Resolution Issues 565
Scaling Issues 571
Snap Views 575
Orientation Changes 580
Simple Page Navigation 583
The Back Stack 588
Navigation Events and Page Restoration 590
Saving and Restoring Application State 594
Navigational Accelerators and Mouse Buttons 598
Passing and Returning Data 601
Visual Studio Standard Templates 607
View Models and Collections 614
Grouping the Items 634
Part II: Specialties 639
Chapter 13: Touch, Etc. 641
A Pointer Roadmap 642
A First Dab at Finger Painting 645
Capturing the Pointer 648
Editing with a Popup Menu 656
Pressure Sensitivity 659
Smoothing the Tapers 663
How Do I Save My Drawings? 672
Real and Surreal Finger Painting 673
A Touch Piano 675
Manipulation, Fingers, and Elements 681
Working with Inertia 689
An XYSlider Control 693
Centered Scaling and Rotation 699
Single-Finger Rotation 702
Chapter 14: Bitmaps 709
Pixel Bits 710
Transparency and Premultiplied Alphas 717
A Radial Gradient Brush 722
Loading and Saving Image Files 729
Posterize and Monochromize 740
Saving Finger Paint Artwork 748
HSL Color Selection 773
Reverse Painting 784
Accessing the Pictures Library 789
Capturing Camera Photos 798
Chapter 15: Going Native 805
An Introduction to P/Invoke 806
Some Help 812
Time Zone Information 812
A Windows Runtime Component Wrapper for DirectX 834
DirectWrite and Fonts 835
Configurations and Platforms 847
Interpreting Font Metrics 850
Drawing on a SurfaceImageSource 857
Chapter 16: Rich Text 871
Private Fonts 873
A Taste of Glyphs 876
Font Files in Local Storage 878
Typographical Enhancements 882
RichTextBlock and Paragraphs 884
RichTextBlock Selection 888
RichTextBlock and Overflow 888
The Perils of Pagination 896
Rich Editing with RichEditBox 903
Your Own Text Input 913
Chapter 17: Share and Print 919
Settings and Popups 920
Sharing Through the Clipboard 924
The Share Charm 929
Basic Printing 930
Printable and Unprintable Margins 937
The Pagination Process 940
Custom Printing Properties 948
Printing a Monthly Planner 954
Printing a Range of Pages 963
Where to Do the Big Jobs? 974
Printing FingerPaint Art 974
Chapter 18: Sensors and GPS 979
Orientation and Orientation 979
Acceleration, Force, Gravity, and Vectors 984
Follow the Rolling Ball 995
The Two Norths 999
Inclinometer = Accelerometer + Compass 1002
OrientationSensor = Accelerometer + Compass 1006
Azimuth and Altitude 1012
Bing Maps and Bing Map Tiles 1025
Chapter 19: Pen (Also Known as Stylus) 1039
The InkManager Collections 1040
The Ink Drawing Attributes 1043
Erasing and Other Enhancements 1049
Selecting Strokes 1055
The Yellow Pad 1064
Index 1083
About the Author 1135
Survey page 1136
Cover 1
Copyright page 2
Contents at a Glance 3
Table of Contents 5
Introduction 15
The Versions of Windows 8 15
The Focus of This Book 17
The Approach 19
Source Code 20
My Setup 20
The Programming Windows Heritage 21
More in the Future 24
Behind the Scenes 25
Errata & Book Support 25
We Want to Hear from You 26
Stay in Touch 26
Part I: Elementals 27
Chapter 1: Markup and Code 29
The First Project 29
Graphical Greetings 35
Variations in Text 39
Media As Well 48
The Code Alternatives 49
Images in Code 53
Not Even a Page 55
Chapter 2: XAML Syntax 57
The Gradient Brush in Code 57
Property-Element Syntax 60
Content Properties 63
The TextBlock Content Property 67
Sharing Brushes (and Other Resources) 69
Resources Are Shared 73
Exploring Vector Graphics 74
Stretching with Viewbox 84
Styles 86
A Taste of Data Binding 92
Chapter 3: Basic Event Handling 95
The Tapped Event 95
Routed Event Handling 98
Overriding the Handled Setting 104
Input, Alignment, and Backgrounds 106
Size and Orientation Changes 109
Bindings to Run? 113
Timers and Animation 115
Chapter 4: Presentation with Panels 123
The Border Element 123
Rectangle and Ellipse 127
The StackPanel 129
Horizontal Stacks 132
WhatSize with Bindings (and a Converter) 134
The ScrollViewer Solution 138
Layout Weirdness or Normalcy? 144
Making an E-Book 145
Fancier StackPanel Items 148
Deriving from UserControl 150
Creating Windows Runtime Libraries 153
The Wrap Alternative 156
The Canvas and Attached Properties 158
The Z-Index 162
Canvas Weirdness 163
Chapter 5: Control Interaction 165
The Control Difference 165
The Slider for Ranges 167
The Grid 172
Orientation and Aspect Ratios 178
Slider and the Formatted String Converter 180
Tooltips and Conversions 180
Sketching with Sliders 183
The Varieties of Button Experience 185
Defining Dependency Properties 193
RadioButton Tags 203
Keyboard Input and TextBox 210
Touch and Thumb 213
Chapter 6: WinRT and MVVM 219
MVVM (Brief and Simplified) 219
Data Binding Notifications 220
A View Model for ColorScroll 222
Syntactic Shortcuts 227
The DataContext Property 230
Bindings and TextBox 232
Buttons and MVVM 238
The DelegateCommand Class 239
Chapter 7: Asynchronicity 247
Threads and the User Interface 247
Working with MessageDialog 248
Callbacks as Lambda Functions 254
The Amazing await Operator 255
Cancelling an Asynchronous Operation 257
Approaches to File I/O 259
Application Local Storage 260
File Pickers 260
Bulk Access 261
File Pickers and File I/O 261
Handling Exceptions 266
Consolidating Async Calls 267
Streamlined File I/O 269
Application Lifecycle Issues 271
Your Own Asynchronous Methods 276
Chapter 8: App Bars and Popups 287
Implementing Context Menus 287
The Popup Dialog 291
Application Bars 294
The Application Bar Button Style 297
Inside the Segoe UI Symbol Font 302
App Bar CheckBox and RadioButton 309
An App Bar for a Note Pad 312
Introducing XamlCruncher 319
Application Settings and View Models 334
The XamlCruncher Page 337
Parsing the XAML 342
XAML Files In and Out 344
The Settings Dialog 348
Beyond the Windows Runtime 353
Chapter 9: Animation 355
The Windows.UI.Xaml.Media.Animation Namespace 355
Animation Basics 356
Animation Variation Appreciation 360
Other Double Animations 366
Animating Attached Properties 373
The Easing Functions 376
All-XAML Animations 385
Animating Custom Classes 390
Key Frame Animations 393
The Object Animation 397
Predefined Animations and Transitions 399
Chapter 10: Transforms 403
A Brief Overview 403
Rotation (Manual and Animated) 406
Visual Feedback 412
Translation 414
Transform Groups 417
The Scale Transform 422
Building an Analog Clock 426
Skew 432
Making an Entrance 435
Transform Mathematics 436
The Composite Transform 444
Geometry Transforms 447
Brush Transforms 448
Dude, Where鈥檚 My Element? 453
Projection Transforms 456
Deriving a Matrix3D 463
Chapter 11: The Three Templates 475
Data in a Button 476
Making Decisions 486
Collection Controls and the Real Use of DataTemplate 489
Collections and Interfaces 500
Tapping and Selecting 501
Panels and Virtualizing Panels 507
Custom Panels 510
The Item Template Bar Chart 523
The FlipView Control 526
The Basic Control Template 528
The Visual State Manager 539
Using generic.xaml 546
Template Parts 547
Custom Controls 556
Templates and Item Containers 561
Chapter 12: Pages and Navigation 565
Screen Resolution Issues 565
Scaling Issues 571
Snap Views 575
Orientation Changes 580
Simple Page Navigation 583
The Back Stack 588
Navigation Events and Page Restoration 590
Saving and Restoring Application State 594
Navigational Accelerators and Mouse Buttons 598
Passing and Returning Data 601
Visual Studio Standard Templates 607
View Models and Collections 614
Grouping the Items 634
Part II: Specialties 639
Chapter 13: Touch, Etc. 641
A Pointer Roadmap 642
A First Dab at Finger Painting 645
Capturing the Pointer 648
Editing with a Popup Menu 656
Pressure Sensitivity 659
Smoothing the Tapers 663
How Do I Save My Drawings? 672
Real and Surreal Finger Painting 673
A Touch Piano 675
Manipulation, Fingers, and Elements 681
Working with Inertia 689
An XYSlider Control 693
Centered Scaling and Rotation 699
Single-Finger Rotation 702
Chapter 14: Bitmaps 709
Pixel Bits 710
Transparency and Premultiplied Alphas 717
A Radial Gradient Brush 722
Loading and Saving Image Files 729
Posterize and Monochromize 740
Saving Finger Paint Artwork 748
HSL Color Selection 773
Reverse Painting 784
Accessing the Pictures Library 789
Capturing Camera Photos 798
Chapter 15: Going Native 805
An Introduction to P/Invoke 806
Some Help 812
Time Zone Information 812
A Windows Runtime Component Wrapper for DirectX 834
DirectWrite and Fonts 835
Configurations and Platforms 847
Interpreting Font Metrics 850
Drawing on a SurfaceImageSource 857
Chapter 16: Rich Text 871
Private Fonts 873
A Taste of Glyphs 876
Font Files in Local Storage 878
Typographical Enhancements 882
RichTextBlock and Paragraphs 884
RichTextBlock Selection 888
RichTextBlock and Overflow 888
The Perils of Pagination 896
Rich Editing with RichEditBox 903
Your Own Text Input 913
Chapter 17: Share and Print 919
Settings and Popups 920
Sharing Through the Clipboard 924
The Share Charm 929
Basic Printing 930
Printable and Unprintable Margins 937
The Pagination Process 940
Custom Printing Properties 948
Printing a Monthly Planner 954
Printing a Range of Pages 963
Where to Do the Big Jobs? 974
Printing FingerPaint Art 974
Chapter 18: Sensors and GPS 979
Orientation and Orientation 979
Acceleration, Force, Gravity, and Vectors 984
Follow the Rolling Ball 995
The Two Norths 999
Inclinometer = Accelerometer + Compass 1002
OrientationSensor = Accelerometer + Compass 1006
Azimuth and Altitude 1012
Bing Maps and Bing Map Tiles 1025
Chapter 19: Pen (Also Known as Stylus) 1039
The InkManager Collections 1040
The Ink Drawing Attributes 1043
Erasing and Other Enhancements 1049
Selecting Strokes 1055
The Yellow Pad 1064
Index 1083
About the Author 1135
Survey page 1136 (as-gbk-encoding)
Alternative filename
upload/misc_2025_10/IXKXcI5mZnjhFnLAUPaa/E-Books/computer/windows/9780735671768_programming_windows_a11a.pdf
Alternative filename
upload/duxiu_main/v/pdf/[Windows编程(第6版,Final.Edition)].(Programming.Windows).Charles.Petzold.文字版.pdf
Alternative filename
nexusstc/Programming Windows/6fc76c48b833edf57d5a890a7c0e0085.pdf
Alternative filename
lgli/Programming Windows_ Writing Windows 8 apps with C_ and XAML.pdf
Alternative filename
lgrsnf/Programming Windows_ Writing Windows 8 apps with C_ and XAML.pdf
Alternative filename
zlib/Computers/Programming/Charles Petzold/Programming Windows: Writing Windows 8 apps with C# and XAML_2042063.pdf
Alternative title
Программирование для Microsoft Windows 8: разработка приложений для Windows Store на C и XAML
Alternative title
Programming Windows, Sixth Edition: Writing Windows 8 Apps with C# and XAML
Alternative title
Programming Windows, Sixth Edition E-Book
Alternative author
Чарльз Петцольд; [пер. с англ. Е. Матвеев]
Alternative author
Petzold, Charles
Alternative author
Петцольд, Чарльз
Alternative publisher
Питер
Alternative edition
Мастер-класс, 6-е изд., Москва [и др.], Russia, 2014
Alternative edition
Pearson Education (US), Redmond, Wash, 2012
Alternative edition
Sixth edition, Redmond, Washington, 2013
Alternative edition
United States, United States of America
Alternative edition
6th ed, Redmond, Wash, ©2012
Alternative edition
6th, 2013-02-04
Alternative edition
Feb 04, 2013
metadata comments
0
metadata comments
lg887778
metadata comments
producers:
Adobe PDF Library 9.9
Adobe PDF Library 9.9
metadata comments
{"edition":"6","isbns":["0735671710","0735671761","9780735671713","9780735671768"],"last_page":800,"publisher":"Microsoft Press"}
metadata comments
类型: 图书
metadata comments
出版日期: 2013
metadata comments
Фактическая дата выхода книги: 2013 г.
Пер. : Petzold, Charles Programming Windows 6nd ed. Microsoft Press, cop. 2013 978-0735671768
Пер. : Petzold, Charles Programming Windows 6nd ed. Microsoft Press, cop. 2013 978-0735671768
metadata comments
РГБ
metadata comments
Russian State Library [rgb] MARC:
=001 006692029
=005 20131119172632.0
=008 131107s2014\\\\ru\\\\\\\\\\\\000\|\rus|d
=017 \\ $a 13-90208 $b RuMoRKP
=020 \\ $a 978-5-496-00863-1
=040 \\ $a RuMoRKP $b rus $e rcr $d RuMoRGB
=041 1\ $a rus $h eng
=080 \\ $a 004.451
=084 \\ $a З973.26-018.2,0 $2 rubbk
=100 1\ $a Петцольд, Чарльз
=245 00 $a Программирование для Microsoft Windows 8 $h [Текст] : $b разработка приложений для Windows Store на C и XAML $c Чарльз Петцольд ; [пер. с англ. Е. Матвеев]
=250 \\ $a 6-е изд.
=260 \\ $a Москва [и др.] $b Питер $c 2014
=300 \\ $a 1008 с. $b ил., табл. $c 24 см
=336 \\ $a текст (text) $b txt $2 rdacontent
=337 \\ $a неопосредованный (unmediated) $b n $2 rdamedia
=338 \\ $a том (volume) $b nc $2 rdacarrier
=490 0\ $a Мастер-класс
=500 \\ $a Фактическая дата выхода книги: 2013 г.
=534 \\ $p Пер. : $a Petzold, Charles $t Programming Windows $b 6nd ed. $c Microsoft Press, cop. 2013 $z 978-0735671768
=650 \7 $a Вычислительная техника -- Вычислительные машины электронные цифровые -- Персональные компьютеры -- Программирование -- Операционные системы $2 rubbk
=650 \7 $a MICROSOFT WINDOWS 8, операционная система $0 RU\NLR\AUTH\661580994 $2 nlr_sh
=653 \\ $a Microsoft Windows 8
=852 \\ $a РГБ $b FB $j 3 13-34/98 $x 90
=852 7\ $a РГБ $b CZ2 $h З973.26-1/П31 $p 81596 $x 83
=001 006692029
=005 20131119172632.0
=008 131107s2014\\\\ru\\\\\\\\\\\\000\|\rus|d
=017 \\ $a 13-90208 $b RuMoRKP
=020 \\ $a 978-5-496-00863-1
=040 \\ $a RuMoRKP $b rus $e rcr $d RuMoRGB
=041 1\ $a rus $h eng
=080 \\ $a 004.451
=084 \\ $a З973.26-018.2,0 $2 rubbk
=100 1\ $a Петцольд, Чарльз
=245 00 $a Программирование для Microsoft Windows 8 $h [Текст] : $b разработка приложений для Windows Store на C и XAML $c Чарльз Петцольд ; [пер. с англ. Е. Матвеев]
=250 \\ $a 6-е изд.
=260 \\ $a Москва [и др.] $b Питер $c 2014
=300 \\ $a 1008 с. $b ил., табл. $c 24 см
=336 \\ $a текст (text) $b txt $2 rdacontent
=337 \\ $a неопосредованный (unmediated) $b n $2 rdamedia
=338 \\ $a том (volume) $b nc $2 rdacarrier
=490 0\ $a Мастер-класс
=500 \\ $a Фактическая дата выхода книги: 2013 г.
=534 \\ $p Пер. : $a Petzold, Charles $t Programming Windows $b 6nd ed. $c Microsoft Press, cop. 2013 $z 978-0735671768
=650 \7 $a Вычислительная техника -- Вычислительные машины электронные цифровые -- Персональные компьютеры -- Программирование -- Операционные системы $2 rubbk
=650 \7 $a MICROSOFT WINDOWS 8, операционная система $0 RU\NLR\AUTH\661580994 $2 nlr_sh
=653 \\ $a Microsoft Windows 8
=852 \\ $a РГБ $b FB $j 3 13-34/98 $x 90
=852 7\ $a РГБ $b CZ2 $h З973.26-1/П31 $p 81596 $x 83
Alternative description
Reimagined for full-screen and touch-optimized apps, Windows 8 provides a platform for reaching new users in new ways. In response, programming legend Charles Petzold is rewriting his classic Programming Windows—one of the most popular programming books of all time—to show developers how to use existing skills and tools to build Windows 8 apps. Programming Windows, Sixth Edition focuses on creating Windows 8 apps accessing the Windows Runtime with XAML and C#. The book also provides C++ code samples. The Sixth Edition is organized in two parts: Part I, “Elementals,” begins with the interrelationship between code and XAML, basic event handling, dynamic layout, controls, templates, asynchronous processing, the application bar, control customization, and collections. You should emerge from Part I ready to create sophisticated page-oriented collection-based user interfaces using the powerful ListView and GridView controls. Part II, “Specialties,” explores topics you might not need for every program but are essential to a well-rounded education in Windows 8. These include multitouch, bitmap graphics, interfacing with share and search facilities, printing, working with the sensors (GPS and orientation), text, obtaining input from the stylus (including handwriting recognition), accessing web services, calling Win32 and DirectX functions, and bringing your application to the Windows 8 app store.
date open sourced
2013-03-25
🚀 Fast downloads
Become a member to support the long-term preservation of books, papers, and more. To show our gratitude for your support, you get fast downloads. ❤️
- Fast Partner Server #1 (recommended)
- Fast Partner Server #2 (recommended)
- Fast Partner Server #3 (recommended)
- Fast Partner Server #4 (recommended)
- Fast Partner Server #5 (recommended)
- Fast Partner Server #6 (recommended)
- Fast Partner Server #7
- Fast Partner Server #8
- Fast Partner Server #9
- Fast Partner Server #10
- Fast Partner Server #11
🐢 Slow downloads
From trusted partners. More information in the FAQ. (might require browser verification — unlimited downloads!)
- Slow Partner Server #1 (slightly faster but with waitlist)
- Slow Partner Server #2 (slightly faster but with waitlist)
- Slow Partner Server #3 (slightly faster but with waitlist)
- Slow Partner Server #4 (slightly faster but with waitlist)
- Slow Partner Server #5 (no waitlist, but can be very slow)
- Slow Partner Server #6 (no waitlist, but can be very slow)
- Slow Partner Server #7 (no waitlist, but can be very slow)
- Slow Partner Server #8 (no waitlist, but can be very slow)
- After downloading: Open in our viewer
All download options have the same file, and should be safe to use. That said, always be cautious when downloading files from the internet, especially from sites external to Anna’s Archive. For example, be sure to keep your devices updated.
External downloads
-
For large files, we recommend using a download manager to prevent interruptions.
Recommended download managers: Motrix -
You will need an ebook or PDF reader to open the file, depending on the file format.
Recommended ebook readers: Anna’s Archive online viewer, ReadEra, and Calibre -
Use online tools to convert between formats.
Recommended conversion tools: CloudConvert and PrintFriendly -
You can send both PDF and EPUB files to your Kindle or Kobo eReader.
Recommended tools: Amazon‘s “Send to Kindle” and djazz‘s “Send to Kobo/Kindle” -
Support authors and libraries
✍️ If you like this and can afford it, consider buying the original, or supporting the authors directly.
📚 If this is available at your local library, consider borrowing it for free there.
Total downloads:
A “file MD5” is a hash that gets computed from the file contents, and is reasonably unique based on that content. All shadow libraries that we have indexed on here primarily use MD5s to identify files.
A file might appear in multiple shadow libraries. For information about the various datasets that we have compiled, see the Datasets page.
For information about this particular file, check out its JSON file. Live/debug JSON version. Live/debug page.