Using and extending your generated project

April 5, 2022 ยท View on GitHub

UWP projects created with Template Studio (aka TS) are intended as a starting point, and will require modification and extension before they're finished. This page explains common ways to extend what is generated for you.

Understanding generated code from Template Studio

The final generated code is the result of a project configuration (project type and design pattern) and a multiple template choice (pages and features). There are a few concepts to understand before start working on the generated code.

Understanding concepts for Template Studio

Template Studio approaches UWP app creation using the following attribute sets to decide how to best generate your app. Below are descriptions of everything you can do.

Project Types

Project types define the basic look and feel of your UWP app.

Project typeDescription
BlankThis basic project is a blank canvas upon which to build your app. It provides no scaffolding and leaves everything up to you.
Navigation PaneThis project includes a navigation pane (or 'hamburger menu') at the side of the screen to enable easy user navigation between pages. This style is popular in mobile apps, but also works well on larger screens. The menu can be hidden when space is limited, or when it isn't needed.
Horizontal Navigation PaneNavigation Items across the top allow for quickly navigating between pages. This is recommended if you have 5 or fewer top level navigation items. The user can navigate between pages by selecting from the text headers, which are always displayed.
Menu BarThis project contains a top menu bar with File and Views options and a Blank canvas to show your views. The project includes navigation methods to show views in different ways.

Design patterns

App Design patterns define the coding pattern that will be used across the project, tying your UI and code together. Template Studio currently supports the following common patterns:

Design patternDescription
MVVM ToolkitThe Microsoft.Toolkit.Mvvm package is a modern, fast, and modular MVVM library. It is part of the Windows Community Toolkit.
Code BehindCode is coupled directly with a XAML file using a .xaml.cs extension. If you developed in WinForms and feel comfortable with that style of development, this is a great option for you.
PrismPrism is a framework for building loosely coupled, maintainable, and testable XAML applications. It was originally based on guidance from Microsoft's Patterns and Practices team but is now supported by an open source community. It is designed to help build rich client applications that are flexible and easy to maintain by composing different modules and following design patterns.
TS only supports the use of Prism with projects created in C#.
Caliburn.MicroCaliburn.Micro is a small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability.
It uses a convention based approach to mapping actions/events, bindings, and views to view models. While this framework is highly opinionated about how it should be used and apps should be constructed, it does allow for customization of it's behavior.
TS only supports the use of Caliburn.Micro with projects created in C#.
Support for Caliburn.Micro is deprecated and will be removed in a future version.
MVVM BasicMVVM Basic includes the minimum necessary to follow the MVVM pattern without including any extra libraries or dependencies. It is intended for people new to MVVM or who are unable to or do not wish to use a 3rd party framework.
Support for MVVM Basic is deprecated and will be removed in a future version.
MVVMLightThe MVVM Light Toolkit is a popular, 3rd party toolkit by Laurent Bugnion, which has the purpose of accelerating the creation and development of MVVM applications. This toolkit puts a special emphasis on the "blend ability" of the created application (the ability to open and edit the user interface into Blend), including the creation of design-time data to enable Blend users to "see something" when they work with data controls.
As a toolkit, it provides a number of tools and features but there is no requirement to use all of them. This toolkit is popular with developers who want use parts of it to take care of the basics but still allow them to structure the code in their own way.
Support for MVVM Light is deprecated and will be removed in a future version.

Pages

PageDescription
BlankThis is the most basic page. A blank canvas to mold into whatever you wish.
SettingsThe settings page is the page where we recommend putting the configuration settings for your app.
Web ViewThe web view page renders web content using the Microsoft Edge rendering engine.
Media PlayerA page for showing video with system media controls enabled.
List/DetailsThe list-details page has a list pane and a details pane for content.
TreeViewThe tree-view page has a tree view control to show hierarchical content.
Content GridThis page allows you to add custom items in the form of an Adaptive Grid.
DataGridA page displaying a simple data grid.
Telerik Data GridA page displaying a simple grid, powered by Telerik UI controls for UWP.
ChartA page displaying a simple chart, powered by Telerik UI controls for UWP.
TabbedPivotThe tabbed page is used for navigating frequently accessed, distinct content categories.
TabViewThe tab view page has a TabView control to show contents in different tabs.
TwoPaneViewList-Details page optimized for dual-screen devices.
MapThe map page is based around the Windows Map Control. Code includes adding a Map Icon and getting your location.
CameraA page for capturing and displaying an image from the camera.
Image GalleryA page displaying a image gallery and allows user to navigate between gallery and image detail.
Ink DrawA page that allows you to create notes and drawings using Windows Ink.
Ink Smart CanvasA page that allows you to create notes using shape and text recognition with Windows Ink.
Ink Draw PictureA page that allows you to load a picture and draw on top of it using Windows Ink.

Features

Analytics

FeatureDescription
VS App Center AnalyticsSend analytics to the Visual Studio App Center.

Application Launching

FeatureDescription
3D App LauncherInclude a 3D app launcher when the app is used in a Mixed Reality environment.
Deep LinkingAdd the ability to launch and deep link into the app with a custom URI scheme.
UserActivityAdd the ability to add user activities to the Windows Timeline.
Web to App linkWeb to App link associates your app with a website so that when someone opens a link to your website.
Command Line LaunchSupport passing arguments and launching from the command line.
Multi-InstanceLaunch multiple instances of the app.
Multi-Instance AdvancedControl how multiple instances of the app are launched.

Application Lifecycle

FeatureDescription
Settings StorageSetting storage helps simplify storing data inside your application data folder.
Suspend and ResumeA simple service you can hook into to handle when a user leaves and returns to the app.
Multiple ViewsEnable your users to view independent parts of your app in separate windows.

Background Work

FeatureDescription
Background TaskAdd an in-process background task ready to run code even while the app is not in the foreground.

Connected Experiences

FeatureDescription
Share SourceHelps supporting the share contract in your UWP app to share data from your app with others.
Share TargetAllows you to receive data shared by other apps using the share contract in your UWP app.

User Interactions

FeatureDescription
Toast NotificationAdds code to show displaying a toast and handling it being used to launch the app.
Azure NotificationsRegister to receive and handle messages from Azure Notification Hubs.
Dev Center NotificationRegister your app to receive notifications from the store.
Live TileAdds a sample to show updating the tile as well as code for working with multiple tiles.
First Run PromptDisplay a prompt when the app is used for the first time.
What's New PromptDisplay a prompt when the app is first used after an update.
Feedback Hub LinkAdd a link, on the settings page, to the Feedback Hub.
Drag & DropThe Drag & Drop feature provides a service to simplify the creation of drag and drop ready apps.
Theme SelectionAdds theming support to your application.

Services

Data

ServiceDescription
HTTP Data ServiceAccess content over HTTP.
Web APIInclude ASP.NET Core Web API project.
Secured Web APIInclude a ASP.NET Core Web API project that validates a JWToken.
SQL Server DataGet data from SQL Server to use in the app.

Authentication (Select one)

ServiceDescription
Forced LoginMake your application require the user to login.
Optional LoginMake your application have an optional login and restricted features.

Tools

ServiceDescription
XAML Styler ConfigDefault XAML Styler config file.

Testing

Testing projectDescription
Test App with MSTestAdd a project for unit tests against the app using MSTest.
Test App with xUnitAdd a project for unit tests against the app using xUnit.
Test Core library with MSTestAdd a project to test code in the Core library with MSTest.
Test Core library with nUnitAdd a project to test code in the Core library with nUnit.
Test Core library with xUnitAdd a project to test code in the Core library with xUnit.
Win App DriverAdd project for UI tests using Appium via Windows Application Driver.

Pre-requisites

The minimum supported Windows 10 version and which SDKs should be pre-installed are detailed in the TS Principles.

Learn more