Developer tasks for building a Windows Store business app using C#, XAML, and Prism
Learn about the key developer tasks that you will need to perform when developing a Windows Store business app. Included are tasks for pages, touch, validation, application data, tiles, search, performance, testing, extended splash screens, incremental loading, and the Prism libraries.
After you download the code, see Getting started using Prism for the Windows Runtime for instructions on how to compile and run the reference implementation, as well as understand the Microsoft Visual Studio solution structure.
- Windows Runtime for Windows 8.1
- Extensible Application Markup Language (XAML)
This article provides lists to help you accomplish different tasks when developing Windows Store business apps. The goal is to lessen the time it takes you to perform a developer task. While many of the tasks link to content that discusses how to use Prism to solve the problem, this is not always the case. In addition, the task lists are not meant to provide you with detailed steps required to complete a task. If you require more info, the content that is linked to includes links to other relevant documentation.
When developing a Windows Store business app you will need to make some key decisions that will define the architecture of your app. The documentation includes guidance on:
- Making the key decisions that will affect the development of a Windows Store business app.
- Using checklists to create a high quality, maintainable, and testable Windows Store business app.
Prism for the Windows Runtime provides two libraries that help developers create Windows Store apps using C#. The libraries accelerate development by providing support for bootstrapping MVVM apps, state management, validation of user input, navigation, event aggregation, data binding, commands, and settings. The libraries can be used separately or together.
- Using the Model-View-ViewModel (MVVM) pattern
The MVVM pattern lends itself naturally to Windows Store apps that use XAML. The documentation includes guidance on:
- Creating a Windows Store app project using Prism and Unity.
- Creating a view using Prism.
- Creating a view model class using Prism.
- Creating a model class with validation support using Prism.
- Connecting view models to views.
- Changing the convention for naming and locating views using Prism.
- Changing the convention for naming, locating, and associating view models with views using Prism.
- Registering a view model factory with views instead of using a dependency injection container.
- Bootstrapping an MVVM app using Prism's MvvmAppBase class and the Unity dependency injection container.
- Updating a view in response to changes in the underlying view model or model.
- Creating and invoking commands from views.
- Creating and invoking Blend for Microsoft Visual Studio 2013 behaviors from views.
- Navigating between pages
Navigation within a Windows Store app can result from the user's interaction with the UI or from the app itself as a result of internal logic-driven state changes. The documentation includes guidance on:
- Validating user input
Any app that accepts input from users should ensure that the data is valid. An app could, for example, check that the input contains only characters in a particular range, is of a certain length, or matches a particular format. Validation can be synchronous or asynchronous, and without it a user can supply data that causes the app to fail. Validation enforces business rules, and prevents an attacker from injecting malicious data. The documentation includes guidance on:
- Validating data stored in a bound model object.
- Specifying validation rules for model properties by using data annotations.
- Triggering validation when property values change.
- Triggering validation on all properties.
- Highlighting validation errors with a custom Blend behavior.
- Saving validation errors when the app suspends, and restore them when the app is reactivated after termination.
- Managing application data
Application data is data that an app creates and manages. The documentation includes guidance on:
- Handling suspend, resume, and activation
Windows Store apps should be designed to save their state and suspend when the user switches away from them. They should restore their state and resume when the user switches back to them. The documentation includes guidance on:
- Communicating between loosely coupled components
Event aggregation is a design pattern that enables communication between classes that are inconvenient to link by object and type references. This mechanism allows publishers and subscribers to communicate without having a reference to each other. The documentation includes guidance on:
- Defining a pub/sub event.
- Publishing a pub/sub event.
- Subscribing to a pub/sub event.
- Subscribing to a pub/sub event on the UI thread.
- Performing event subscription filtering.
- Subscribing to a pub/sub event by using strong references.
- Manually unsubscribing from a pub/sub event when using a strong delegate reference.
Good Windows Store apps share an important set of traits that provide a consistent, elegant, and compelling user experience. Planning ahead for different form factors, accessibility, monetization, and selling in the global market can reduce your development time and make it easier to create a high quality app and get it certified. The documentation includes guidance on:
Windows Store app pages need to support a fluid layout such as landscape, portrait, and minimal view states to be responsive to user resizing requests and support for running on multiple devices. The user can change the screen size, orientation, and even input method and the app needs to respond to these requests. The app also needs to provide navigation between pages, accessibility, and optionally localization. The documentation includes guidance on:
- Creating pages that support design time data.
- Supporting multiple view states.
- Using a custom GridView control that responds to layout changes.
- Using a custom GridView control that displays items at multiple sizes.
- Enabling page localization.
- Ensuring your app is accessible.
- Navigating between pages.
Microsoft Windows provides a concise set of touch interactions that are used throughout the system. Applying this language consistently makes your app feel familiar to what users already know, increasing user confidence by making your app easier to learn and use. The documentation includes guidance on:
Application data is data that an app creates and manages. It is specific to the internal functions or configuration of the app, and includes runtime state, user preferences, reference content, and other settings. Application data is created, read, updated, deleted, and cached when an app is running. The documentation includes guidance on:
A tile is an app's representation on the Start screen and allows you to present rich and engaging content to your users when the app is not running. Tiles should be appealing to users in order to give them great first-impression of your Windows Store app. The documentation includes guidance on:
- Creating an app tile.
- Using periodic notifications to update tile content.
- Pinning and unpinning secondary tiles to the Start screen from within an app.
- Launching the app to a specific page from a secondary tile.
You should use the SearchBox control to let users search for content in your app, in order to ensure that they have a consistent and predictable experience when they search. Regardless of where your app’s content is located, you can use the search box to respond to user’s queries and display search results in an app page of your own design. The documentation includes guidance on:
- Using the SearchBox control to implement search functionality.
- Providing query suggestions that help the user search quickly.
Users of Windows Store apps expect their apps to remain responsive and feel natural when they use them. The documentation includes guidance on:
Testing helps to ensure that an app is robust, reliable, and of high quality. The documentation includes guidance on:
- Testing synchronous functionality.
- Testing asynchronous functionality.
- Testing suspend and resume functionality.
An extended splash screen is a splash screen that stays on the screen for an extended period of time. Extended splash screens should be displayed when an app needs more time to prepare its initial UI. The documentation includes guidance on:
- Creating an extended splash screen using Prism.
- Responding to resize and image opened events for the extended splash screen.
- Displaying an extended splash screen using Prism.
Incremental loading enables an item template in a GridView or ListView to render its controls in phases, thereby creating a more responsive and useful UI when the user scrolls through large data sets. The documentation includes guidance on:
- Improving the perceived performance of a GridView control by using the Blend IncrementalUpdateBehavior.
- Improving the perceived performance of a GridView control by using the ContainerContentChanging event.