You are previewing Mastering Windows 8 C++ App Development.
O'Reilly logo
Mastering Windows 8 C++ App Development

Book Description

A practical guide to developing Windows Store apps with C++ and XAML

  • Details the most important features of C++, XAML, and WinRT for building fantastic Windows Store apps

  • Full of detailed and engaging code samples that can be used as a basis for your own projects

  • Provides a clear overview of Windows Runtime and C++/CX

  • In Detail

    Windows 8 provides an unprecedented opportunity for developers to create applications for a new and exciting platform, for an entirely new market. Leveraging modern C++ and the new Windows Runtime, this book guides you through the many facets of WinRT whilst using modern C++ features for ultimate power and performance.

    "Mastering Windows 8 C++ App Development" shows you how to create Windows Store apps that use many of the new features and functionality available for Windows 8. You'll discover how you can harness the power of the new Windows Runtime with C++ combined with XAML for the creation of fantastic user experiences.

    Starting with coverage of C++/CX (a set of extensions that make working with WinRT easier) and user interface design with XAML, this book shows you how to use major Windows 8 features, including Live Tiles and Contracts, while leveraging common patterns such as data binding and the Model View ViewModel (MVVM). You'll discover how WinRT works, its various capabilities, and how it can best be leveraged using C++11 and Visual Studio 2012.

    Table of Contents

    1. Mastering Windows 8 C++ App Development
      1. Table of Contents
      2. Mastering Windows 8 C++ App Development
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code

          2. Errata
          3. Piracy
          4. Questions
      8. 1. Introduction to Windows 8 Apps
        1. Introducing Windows 8
          1. Touch everywhere
          2. The Start (Home) screen
          3. The AppBar
          4. The Charms bar
        2. Desktop apps versus Store apps
        3. The Windows Runtime
        4. Language projections
          1. Building the user interface
        5. Creating your first Store application
          1. Closing an application
          2. Application deployment
          3. Where did int.ToString come from?
          4. Project structure
        6. Summary
      9. 2. COM and C++ for Windows 8 Store Apps
        1. Welcome to C++11
          1. New features in C++11
            1. nullptr
            2. auto
            3. Lambdas
            4. Smart pointers
          2. Conclusion
        2. COM and WinRT
          1. The IUnknown interface
          2. IInspectable interface
          3. Creating a WinRT object
        3. WinRT metadata
        4. The Windows Runtime Library
        5. C++/CX
          1. Creating and managing objects
          2. Accessing members
            1. Methods and properties
            2. Delegates
            3. Events
          3. Defining types and members
            1. A WinRT component project
            2. Adding properties and methods
            3. Adding an event
          4. Consuming a WinRT component
            1. Building a C++ client
            2. Building a C# client
        6. The Application Binary Interface
        7. Asynchronous operations
          1. Using tasks for asynchronous operations
          2. Cancelling asynchronous operations
          3. Error handling
        8. Using existing libraries
          1. STL
          2. MFC
          3. ATL
          4. Win32 API
          5. CRT
          6. DirectX
          7. C++ AMP
        9. The Windows Runtime class library
          1. Strings
          2. Collections
          3. Exceptions
        10. Summary
      10. 3. Building UI with XAML
        1. XAML
          1. XAML basics
          2. Type converters
          3. Complex properties
          4. Dependency properties and attached properties
          5. Content properties
          6. Collection properties
          7. Markup extensions
          8. Naming elements
          9. Connecting events to handlers
          10. XAML rules summary
          11. Introducing the Blend for Visual Studio 2012 tool
          12. XAML compilation and execution
          13. Connecting XAML, H, and CPP files to the build process
        2. Resources
          1. Binary resources
          2. Logical resources
            1. Managing logical resources
            2. Duplicate keys
        3. Styles
          1. Implicit (automatic) styles
          2. Style inheritance
          3. Store application styles
        4. Summary
      11. 4. Layout, Elements, and Controls
        1. Introducing layout
        2. Layout panels
          1. StackPanel
          2. Grid
          3. Canvas
            1. Adding children to a panel dynamically
          4. VariableSizedWrapGrid
          5. Panel virtualization
            1. Virtualizing panels
        3. Working with elements and controls
          1. Content controls
            1. Buttons
            2. ScrollViewer
            3. Other content controls to note
              1. AppBar
              2. Frame
              3. SelectorItem
          2. Collection-based controls
            1. ListBox and ComboBox
            2. ListView and GridView
            3. FlipView
          3. Text-based elements
            1. Using custom fonts
            2. TextBlock
            3. TextBox
            4. PasswordBox
            5. RichTextBlock and RichEditBox
          4. Images
            1. The Stretch property
          5. The SemanticZoom control
        4. Summary
      12. 5. Data Binding
        1. Understanding data binding
          1. Data binding concepts
        2. Element-to-element binding
        3. Object-to-element binding
        4. Binding failures
        5. Change notifications
        6. Binding to collections
        7. Customizing a data view
          1. Value converters
            1. Other parameters for Convert and ConvertBack
          2. Data template selectors
        8. Commands
        9. Introduction to MVVM
          1. MVVM constituents
          2. Building an MVVM framework
          3. More on MVVM
        10. Summary
      13. 6. Components, Templates, and Custom Elements
        1. Windows Runtime Components
          1. Converting C++ to WinRT
          2. Crossing the ABI
          3. Consuming Windows Runtime Components
          4. Other C++ library projects
        2. Custom control templates
          1. Building a control template
            1. Using the control's properties
            2. Handling state changes
            3. Customizing using attached properties
              1. Defining an attached property
        3. Custom elements
          1. User controls
            1. Creating a color picker user control
            2. Dependency properties
            3. Defining dependency properties
            4. Building the UI
            5. Adding events
            6. Using the ColorPicker
          2. Custom controls
            1. Creating a ColorPicker custom control
            2. Binding in code
        4. Custom panels
        5. Custom drawn elements
        6. Summary
      14. 7. Applications, Tiles, Tasks, and Notifications
        1. Application lifecycle
          1. Saving and restoring the state
            1. Determining application execution states
            2. State store options
            3. Helper classes
        2. Live tiles
          1. Setting application tile defaults
          2. Updating the tile's contents
            1. Enabling cycle updates
            2. Tile expiration
            3. Badge updates
          3. Creating secondary tiles
            1. Activating a secondary tile
        3. Using toast notifications
          1. Toast options
        4. Push notifications
          1. Push notification architecture
          2. Building a push notification application
            1. The application server
            2. Registering for push notifications
            3. Issuing the push notification
          3. Push notifications for secondary tiles
        5. Background tasks
          1. What is a task?
          2. Creating and registering a task
          3. Implementing a task
          4. Task debugging
          5. Task progress and cancellation
          6. Playing background audio
            1. Playing audio
            2. Maintaining background audio
            3. Sound-level notifications
          7. Lock screen apps
          8. Requesting to set a lock screen app
          9. Other common operations for lock screen apps
          10. Background tasks limits
        6. Background transfers
          1. Example – downloading a file
        7. Summary
      15. 8. Contracts and Extensions
        1. Capabilities
        2. Contracts
          1. Share contract
            1. Share source
            2. Share target
            3. Sharing files
            4. Sharing page UI generation
          2. FileOpenPicker contract
            1. Implementing a FileOpenPicker contract
          3. Debugging contracts
        3. Extensions
          1. Settings extension
        4. Other contracts and extensions
        5. Summary
      16. 9. Packaging and the Windows Store
        1. The application manifest
        2. The application view state
          1. Implementing view state changes
        3. Packaging and validating
          1. Using the Windows App Certification Kit
        4. Summary
      17. Index