Programming the Windows Runtime by Example: A Comprehensive Guide to WinRT with Examples in C# and XAML (Microsoft Windows Development Series) 9780321927972, 0321927974

Master Windows 8.1/Windows Runtime Programming Through 80 Expert Projects This is the most complete, hands-on, solutions

147 113 18MB

English Pages 816 [814] Year 2014

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Contents
Foreword
Preface
1 The New Windows Runtime
Windows Runtime Specifics
Windows Store Apps
Example: Create a Windows Store App
.NET and WinRT
Fundamental Types
Mapped Types
Streams and Buffers
Desktop Applications
Example: Reference WinRT from a Desktop Application
Example: Examine Projections in a WinRT Component
Asynchronous Functions
Summary
2 Windows Store Apps and WinRT Components
Fundamentals of a Windows Store App
Windows Store App Templates
Understanding the App Manifest
Finding Your Package on Disk
Running Your App
Application Lifecycle
The Navigation Helper and Suspension Manager
Managed WinRT Components
Creating a Managed WinRT Component
Calling Managed WinRT Components from Any Language
Summary
3 Layouts and Controls
The Visual Tree
Data-Binding
Dependency Properties
Attached Properties
Value Precedence
Property Change Notification
Animations
Example: Dynamically Apply Animations to a Control
The Visual State Manager
Example: Visual State Manager
Groups
States
Transitions
The Visual State Manager Workflow
Programmatic Access to Visual States
Custom Visual State Managers
Styles
Templates
Example: Using Templates
Layouts
Panel
Border
Canvas
Grid
StackPanel
VirtualizingPanel and VirtualizingStackPanel
WrapGrid
VariableSizedWrapGrid
ContentControl
ItemsControl
ScrollViewer
ViewBox
GridView
ListBox
ListView
FlipView
Example: Using the Viewbox and Various Layouts
Controls
Flyouts
Custom Controls
Example: Creating a Custom Control
Parsing XAML
HTML Pages
Example: Working with HTML and JavaScript
Summary
4 Data and Content
Example: Data Manipulation with the Skrape App
The Clipboard
Application Storage
Roaming Data
Containers
Settings
Composite Values
Storage Folders and Files
Storage Folders
Storage Files
Buffers and Streams
Path and File Helper Classes
Storage Query Operations
Pickers and Cached Files
Compression
Data Formats
Example: Working with Data Formats
XSLT Transformations
Document Data
Summary
5 Web Services and Syndication
SOAP
REST
OData Client
Syndication
Summary
6 Tiles and Toasts
Tiles
Default Tiles
Live Tiles
Cycling Tile Notifications
Secondary Tiles
Badges
Periodic Notifications
Toasts
Toasts in Desktop Applications
Push Notifications
Registering to Receive Push Notifications
Sending Push Notifications
Summary
7 Connecting to the Cloud
Windows Azure Mobile Services
Example: Managing a Shared Group of Subscribers
Connecting an App to a Mobile Services Instance
Authentication
Data Storage
Custom APIs
Integrated Push Notification Support
Scheduled Tasks
Mobile Services Deployment Tiers
Live Connect
Getting Started
The Example App
Authentication
Working with Profile Information
Working with Contacts
Working with Calendars and Events
Working with OneDrive
Summary
8 Security
Authentication
Multistep Authentication (Google)
Unlocking the Password Vault
Encryption and Signing
The Data Protection Provider
Symmetrical Encryption
Verification
Asymmetric Algorithms
Summary
9 Model-View-ViewModel (MVVM)
UI Design Patterns
The Model
The View
Model-View-Controller (MVC)
Model-View-Presenter (MVP)
Model-View-ViewModel (MVVM)
The ViewModel Decomposed
Common MVVM Misperceptions
Benefits of MVVM
Common MVVM Solutions
Design-Time Data
Accessing the UI Thread
Commands
Handling Dialogs
Selection Lists
Filtered Lists
Validation
Summary
10 Networking
Web and HTTP
HomeGroup
Connectivity and Data Plans
Sockets
WebSockets
UDP and TCP Sockets
Proximity (Near Field Communications)
NFC-Only Scenarios
Tap-to-Connect Scenarios
Background Transfers
Summary
11 Windows Charms Integration
Displaying App Settings
The Settings Example
Adding Settings Entries
Sharing
The Share Source Example
Creating a Share Source App
The Share Target Example
Creating a Share Target App
Debugging Share Target Apps
Using Play To
The Play To Example
Creating a Play To Source App
Creating a Play To Target App
Summary
12 Additional Windows Integration
Integrating with the File and Contact Pickers
The Example App
File Open Picker
File Save Picker
Contact Picker
Application Activation Integration
The Example App
File Activation
Protocol Activation
Account Picture Provider
AutoPlay
Working with Contacts and Appointments
The Example App
Contacts
Appointments
Summary
13 Devices
Working with Input Devices
The Example App
Identifying Connected Input Devices
Pointer, Manipulation, and Gesture Events
Keyboard Input
Sensor Input
The Example App
Geolocation
Geofencing
Motion and Orientation Sensors
Summary
14 Printers and Scanners
Working with Printers
The Example App
Getting Started
Configuring a Print Task
Providing Printing Content
Working with Scanners
The Example App
Determining Scanner Availability
Working with Scan Sources
Previewing
Scanning
Scanner Settings
Summary
15 Background Tasks
The Thread Pool
Uploads and Downloads
Audio
Lock Screen Tasks
Lock Screen Capabilities
The Background Task
Listing Background Tasks
Timer
Conditions
Debugging Background Tasks
Raw Push Notifications
Control Channel
System Events
Summary
16 Multimedia
Playing Multimedia Content
The Example App
Getting Started
Controlling Playback
Appearance
Audio Settings
Media Information
Markers
Acquiring Audio and Video
The Example App
Declaring Application Capabilities
Using CameraCaptureUI
Using MediaCapture
Text-to-Speech Support
The Example App
Using the SpeechSynthesizer
Summary
17 Accessibility
Requested Theme
High Contrast
Keyboard Support
Automation Properties
Testing with Narrator
Automation and Lists
Live Settings
Automation Peers
Accessibility Checker
Summary
18 Globalization and Localization
Design Considerations
Default Language
Configuring Preferred Languages
Resource Qualification and Matching
Localizing XAML Elements
Formatting Dates, Numbers, and Currencies for Locale
MVVM and Localization
Multilingual Toolkit
Summary
19 Packaging and Deploying
Packaging Your App
Creating an App Package
App Package and App Bundle Contents
Package Identifier
Deploying Your App
Publishing Your App in the Windows Store
Other Deployment Options
Making Money with Your App in the Windows Store
The Example App
Pricing Your App in the Windows Store
Trial Mode Apps
In-App Purchases
Including Advertisements
Summary
20 Debugging and Performance Optimization
Understanding the Debugger
Native, Managed, and Script Debuggers
Just My Code
Edit and Continue
Just in Time Debugging
How to Launch the Debugger
Program Databases
Debug Windows
Managing Exceptions
Logging and Tracing
Profiling and Performance Analysis
Performance Tips
CPU Sampling
XAML UI Responsiveness
Energy Consumption
Code Analysis
Summary
A: Under the Covers
Fundamental WinRT Concepts
Namespaces
Base Types
Primitives
Classes and Class Methods
Structures
Generics
Null
Enumerations
Interfaces
Properties
Delegates
Events
Arrays
WinRT Internals
B: Glossary
A
B
C
D
E
G
H
I
J
L
M
N
O
P
R
S
T
U
V
W
X
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Z

Programming the Windows Runtime by Example: A Comprehensive Guide to WinRT with Examples in C# and XAML (Microsoft Windows Development Series)
 9780321927972, 0321927974

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Recommend Papers