Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Programming Windows Store Apps with C#
Preface
Audience
The Application
The Chapters
Prerequisites
Source Code
Using git
Contacting the Authors
Let’s Go!
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
1. Making the Transition from .NET (Part 1)
Why WinRT?
Philosophical Differences
Objectives
The New Project Templates
WinRT Metadata
Project Settings and Adding References
Building a Basic User Interface
UI Tracks
HTML
Better experience
XAML Parsing Basics
Building a Basic Page
Implementing MVVM
WPF and Silverlight
MVVM Structure and Inversion of Control
RegisterPageViewModel
Handling errors
Basic alerts
Creating the View-Model and Running the App
IViewModelHost
Building out the DoRegistration method
Running the application
2. Making the Transition from .NET (Part 2)
Inversion of Control
Installing TinyIoC
Initializing IoC Defaults
Understanding Asynchrony
How Asynchrony Works in WinRT
State machines
Returning “void”
The trick of asynchrony
Calling the Server
Building the Service Proxies
Server protocol
Building the Register Method
Finishing the UI to Call the Register Server Function
Logon
Building LogonServiceProxy
Building the Logon Page
Busy Indicators
Positioning the Indicator
Showing the Indicator
3. Local Persistent Data
SQLite and sqlite-net
Working with SQLite
A Primer on Object-Relational Mapping
Using the Micro-ORM in sqlite-net
Storing Settings
The SettingItem Class
Linking in sqlite-net
Creating the Database Table for SettingItem
Reading and Writing Values
SetValueAsync
GetValueAsync
Modifying LogonPageViewModel
Caching Data Locally
Local Caching
Mapping JSON to Database Entities
Creating Test Reports
Setting Up the User Database
Creating ReportsPage
Using Templates
Building a Local Cache
Updating the Cache
Returning Reports from the Server
The Items Property
4. The App Bar
Adding a Simple App Bar
Getting Started with an App Bar
App Bar Behavior
App Bar with Single-Select Grid
App Bar with Multiselect Grid
A More Complex App Bar Implementation
Showing the App Bar on Multiple Selections
Checking Touch Operations
Showing the App Bar on Right-Click
Showing Context Options
App Bar Images
The Glyph Method
Using Images
Styles in XAML
Creating images for app bar buttons
Creating a template that uses an image
5. Notifications
Local Notifications
Turning Notifications On and Off
XML Templates
Toast
Setting permissions
Toast without an image
Toast with an image
Asynchrony and notifications
Badges
Tiles
Tile template types
Creating a wide tile
Creating TileNotificationBuilder
Other Notification Features
Push Notifications
WNS Process
Handling User Accounts
Obtaining a Notification URI
Sending to WNS
Registering the app
Authenticating
Sending
Troubleshooting Tips
6. Working with Files
The File Picker
File Associations
Launching the App
Handling the Launch
Sandboxed File Access
Walking and Copying Pictures
Roaming Files
Multiple Devices
Setting Up the Remote Debugging Client
Syncing Files
Roaming Settings
Using Files with StreetFoo
Getting Report Images
Migrating to ReportViewItem
Refactoring to ReportViewItem
Modifying the grid item template
Implementing ReportImageCacheManager
Checking for file existence
Downloading and caching images
7. Sharing
Sharing Data
Basic Sharing
Hooking the DataTransferManager into the view-model
Sharing basic data
Sharing images
Sharing other types of data
Pull Requests/Deferrals
Acting as a Share Target
Sharing Text
Sharing Text (and Troubleshooting)
Migrating ShareTargetPage to MVVM
Tracking debug information
Debugging share operations
Fixing the runtime startup problem
Handling shared text
Long-Running Operations
Sharing Images
Configuring the manifest
Reading image data
Testing sharing an image via GetBitmapAsync
Quick Links
8. Searching
Implementing Search
Creating the Search Results Page
Creating SearchResultsPageViewModel
Implementing the Search Operation
Searching SQLite
The search routine proper
Adjusting the presentation
Handling item clicks on the grid
Refining Search
Placeholder Text
Suggestions
Finding suggestions
Finding recommendations
Remembering Where We Were
Using the SearchBox
Other Best-Practice Notes
9. Settings
Adding Options
Standard Options
Adding Custom Options
Implementing the Settings Flyout
Building a Settings Pane
Building MySettingsFlyout
Developing a Help Screen
Creating a Help Pane
Handling the F1 Key
Rendering Markup
10. Location
Creating a Singleton View
Creating the View-Model
Creating the View
Navigating to the View
Retrieving a Current Location
Using the Simulator with Location
Integrating Maps
Adding the Bing Maps Control
Handling Input with the View
Packaging Points for Display
Showing Points on the Map
Shelling to the Maps App
11. Using the Camera
Capturing Photos
Creating EditReportPage
Building EditReportPageViewModel and Its View-Model
Saving and Canceling
Adding the New Option
Handling Temporary Files
Changing the Manifest
Taking Pictures
Implementing Save
Validating and Saving
Resizing Images
12. Responsive Design
Updating the Grid View
The VisualStateManager
Creating MyListView
Modifying the App Bar
Updating Singleton Views
Adding a More Button to the App Bar
Handling Views That Don’t Support 320-Pixel Width
13. Resources and Localization
.pri Files
Adding Strings
Localizing Strings
Default Project Locales
Localizing Strings in XAML
Conventions
Changing Other Properties
Explicitly Loading Strings
Localizing Images
Varying Images by Locale
Varying Images by Display DPI
14. Background Tasks and App Lifetime
App Lifetime
Background Tasks API
CPU Usage Quota
Network constraints
Triggers and Conditions
Execution Model
Implementing a Sync Background Task
Building the Façade
Debugging the Task
Troubleshooting Background Tasks
Restricting the Run Period
Implementing the Sync Function
Sending Changes
Receiving New Work
Signaling the App from the Background Task
Putting the App on the Lock Screen
15. Sideloading and Distribution
Using the Windows App Certification Kit
Distribution Through Production Sideloading
Turning on Sideloading on Windows 8
Installing Apps
Distribution Through the Windows Store
A. Cryptography and Hashing
SSL
Device Security
SQLite
Hashing
Generating Random Data
Symmetric Encryption
B. Unit Testing Basics for Windows Store Apps
Unit Testing for Newbies
Creating a Test Project
Testing RegisterServiceProxy
Starting the Runtime and Handling async Methods
Testing the View-Models
Index
Colophon
Copyright
← Prev
Back
Next →
← Prev
Back
Next →