- ホーム
- > 洋書
- > 英文書
- > Computer / Languages
Full Description
Master Windows 8.1/Windows Runtime Programming Through 80 Expert ProjectsThis is the most complete, hands-on, solutions-focused guide to programming modern Windows applications with the Windows Runtime.Leading Windows development consultants Jeremy Likness and John Garland present easy-to-adapt C# and XAML example code for more than 80 projects. Their real-world application examples help you apply Windows 8.1's best improvements, including large tiles, the new search control, flyouts, command bars, native WinRT networking, and new deployment and sideloading options.Drawing on their pioneering experience, they illuminate key areas of the Windows Runtime API, offering uniquely detailed coverage of encryption, cloud connectivity, devices, printers, and media integration. You'll find cutting-edge tips and tricks available in no other book.This is an indispensable resource for all intermediate-to-advanced Windows developers, and for any architect building desktop, tablet, or mobile solutions with Microsoft technologies. Its focus on both C# and XAML will make it valuable to millions of Windows developers already familiar with Silverlight, WPF, and/or .NET.Coverage includes* Creating robust app interfaces with the newest XAML controls, including flyouts and command bars* Saving data in a persistent "roaming zone" for syncing across Windows 8.1 devices* Using Visual State Manager (VSM) to build apps that adapt to various device resolutions and orientations* Integrating virtually any form of data into your apps* Connecting with web services, RSS, Atom feeds, and social networks* Securing apps via authentication, encrypting, signing, and single sign-on with Microsoft Account, Facebook, Google, and more* Leveraging Windows 8.1 media enhancements that improve battery life and app performance* Networking more effectively with Windows 8.1's revamped HTTP implementation and new location APIs* Using Tiles and Toasts to keep apps alive and connected, even when they aren't running* Enabling users to send content between devices via NFC tap and send* Ensuring accessibility and globalizing your apps* Efficiently debugging, optimizing, packaging, and deploying your apps* Building sideloadable apps that don't have to be published in Windows Store"This book doesn't just focus on singular concepts, it also provides end-to-end perspective on building an app in WinRT. It is one of those essential tools for Windows developers that will help you complete your software goals sooner than without it!" -Tim Heuer, Principal Program Manager Lead, XAML Platform, Microsoft Corporation
Contents
Foreword xixPreface xxiiChapter 1 The New Windows Runtime 1Windows Runtime Specifics 1Windows Store Apps 4Example: Create a Windows Store App 5.NET and WinRT 9Fundamental Types 9Mapped Types 10Streams and Buffers 14Desktop Applications 15Example: Reference WinRT from a Desktop Application 15Example: Examine Projections in a WinRT Component 20Asynchronous Functions 24Summary 27Chapter 2 Windows Store Apps and WinRT Components 29Fundamentals of a Windows Store App 30Windows Store App Templates 32Understanding the App Manifest 45Finding Your Package on Disk 52Running Your App 54Application Lifecycle 61The Navigation Helper and Suspension Manager 67Managed WinRT Components 75Creating a Managed WinRT Component 76Calling Managed WinRT Components from Any Language 78Summary 79Chapter 3 Layouts and Controls 81The Visual Tree 83Data-Binding 85Dependency Properties 91Attached Properties 94Value Precedence 95Property Change Notification 95Animations 97Example: Dynamically Apply Animations to a Control 97The Visual State Manager 100Example: Visual State Manager 101Groups 103States 105Transitions 106The Visual State Manager Workflow 107Programmatic Access to Visual States 109Custom Visual State Managers 109Styles 111Templates 112Example: Using Templates 112Layouts 115Panel 115Border 115Canvas 116Grid 116StackPanel 117VirtualizingPanel and VirtualizingStackPanel 118WrapGrid 119VariableSizedWrapGrid 119ContentControl 120ItemsControl 121ScrollViewer 122ViewBox 122GridView 123ListBox 123ListView 124FlipView 124Example: Using the Viewbox and Various Layouts 125Controls 130Flyouts 133Custom Controls 135Example: Creating a Custom Control 136Parsing XAML 140HTML Pages 143Example: Working with HTML and JavaScript 144Summary 150Chapter 4 Data and Content 153Example: Data Manipulation with the Skrape App 154The Clipboard 154Application Storage 159Roaming Data 161Containers 162Settings 163Composite Values 165Storage Folders and Files 166Storage Folders 168Storage Files 170Buffers and Streams 171Path and File Helper Classes 174Storage Query Operations 176Pickers and Cached Files 180Compression 187Data Formats 191Example: Working with Data Formats 192XSLT Transformations 195Document Data 196Summary 198Chapter 5 Web Services and Syndication 199SOAP 200REST 209OData Client 217Syndication 219Summary 223Chapter 6 Tiles and Toasts 225Tiles 226Default Tiles 227Live Tiles 229Cycling Tile Notifications 234Secondary Tiles 236Badges 239Periodic Notifications 242Toasts 242Toasts in Desktop Applications 248Push Notifications 249Registering to Receive Push Notifications 251Sending Push Notifications 253Summary 259Chapter 7 Connecting to the Cloud 261Windows Azure Mobile Services 262Example: Managing a Shared Group of Subscribers 267Connecting an App to a Mobile Services Instance 267Authentication 269Data Storage 274Custom APIs 289Integrated Push Notification Support 291Scheduled Tasks 297Mobile Services Deployment Tiers 298Live Connect 301Getting Started 302The Example App 304Authentication 304Working with Profile Information 308Working with Contacts 310Working with Calendars and Events 311Working with OneDrive 315Summary 321Chapter 8 Security 323Authentication 324Multistep Authentication (Google) 330Unlocking the Password Vault 331Encryption and Signing 333The Data Protection Provider 333Symmetrical Encryption 337Verification 343Asymmetric Algorithms 345Summary 347Chapter 9 Model-View-ViewModel (MVVM) 349UI Design Patterns 350The Model 351The View 352Model-View-Controller (MVC) 353Model-View-Presenter (MVP) 354Model-View-ViewModel (MVVM) 355The ViewModel Decomposed 356Common MVVM Misperceptions 362Benefits of MVVM 364Common MVVM Solutions 367Design-Time Data 367Accessing the UI Thread 369Commands 371Handling Dialogs 371Selection Lists 371Filtered Lists 373Validation 375Summary 377Chapter 10 Networking 379Web and HTTP 379HomeGroup 382Connectivity and Data Plans 384Sockets 389WebSockets 389UDP and TCP Sockets 392Proximity (Near Field Communications) 397NFC-Only Scenarios 397Tap-to-Connect Scenarios 403Background Transfers 408Summary 412Chapter 11 Windows Charms Integration 415Displaying App Settings 417The Settings Example 418Adding Settings Entries 418Sharing 421The Share Source Example 423Creating a Share Source App 424The Share Target Example 433Creating a Share Target App 434Debugging Share Target Apps 441Using Play To 442The Play To Example 443Creating a Play To Source App 444Creating a Play To Target App 446Summary 448Chapter 12 Additional Windows Integration 451Integrating with the File and Contact Pickers 452The Example App 453File Open Picker 454File Save Picker 458Contact Picker 460Application Activation Integration 462The Example App 463File Activation 463Protocol Activation 467Account Picture Provider 470AutoPlay 471Working with Contacts and Appointments 473The Example App 474Contacts 474Appointments 476Summary 478Chapter 13 Devices 479Working with Input Devices 480The Example App 480Identifying Connected Input Devices 481Pointer, Manipulation, and Gesture Events 484Keyboard Input 495Sensor Input 498The Example App 498Geolocation 502Geofencing 510Motion and Orientation Sensors 517Summary 529Chapter 14 Printers and Scanners 531Working with Printers 532The Example App 532Getting Started 533Configuring a Print Task 534Providing Printing Content 542Working with Scanners 547The Example App 547Determining Scanner Availability 548Working with Scan Sources 549Previewing 550Scanning 551Scanner Settings 552Summary 556Chapter 15 Background Tasks 559The Thread Pool 560Uploads and Downloads 562Audio 563 Lock Screen Tasks 570Lock Screen Capabilities 570The Background Task 573Listing Background Tasks 576Timer 578Conditions 578Debugging Background Tasks 580Raw Push Notifications 581Control Channel 585System Events 587Summary 588Chapter 16 Multimedia 589Playing Multimedia Content 590The Example App 590Getting Started 591Controlling Playback 592Appearance 595Audio Settings 596Media Information 597Markers 597Acquiring Audio and Video 598The Example App 599Declaring Application Capabilities 599Using CameraCaptureUI 600Using MediaCapture 604Text-to-Speech Support 610The Example App 611Using the SpeechSynthesizer 611Summary 613Chapter 17 Accessibility 615Requested Theme 616High Contrast 618Keyboard Support 620Automation Properties 622Testing with Narrator 623Automation and Lists 624Live Settings 625Automation Peers 626Accessibility Checker 627Summary 629Chapter 18 Globalization and Localization 631Design Considerations 632Default Language 633Configuring Preferred Languages 635Resource Qualification and Matching 637Localizing XAML Elements 639Formatting Dates, Numbers, and Currencies for Locale 642MVVM and Localization 643Multilingual Toolkit 644Summary 648Chapter 19 Packaging and Deploying 649Packaging Your App 650Creating an App Package 650App Package and App Bundle Contents 654Package Identifier 655Deploying Your App 657Publishing Your App in the Windows Store 657Other Deployment Options 665Making Money with Your App in the Windows Store 667The Example App 668Pricing Your App in the Windows Store 669Trial Mode Apps 670In-App Purchases 675Including Advertisements 678Summary 683Chapter 20 Debugging and Performance Optimization 685Understanding the Debugger 686Native, Managed, and Script Debuggers 686Just My Code 688Edit and Continue 690Just in Time Debugging 691How to Launch the Debugger 691Program Databases 692Debug Windows 693Managing Exceptions 694Logging and Tracing 696Profiling and Performance Analysis 702Performance Tips 704CPU Sampling 706XAML UI Responsiveness 709Energy Consumption 710Code Analysis 712Summary 717Appendix A Under the Covers 719Fundamental WinRT Concepts 719Namespaces 720Base Types 720Primitives 720Classes and Class Methods 721Structures 722Generics 722Null 723Enumerations 723Interfaces 723Properties 723Delegates 724Events 724Arrays 725WinRT Internals 725Appendix B Glossary 733Index 749