The Application Definition

The application definition is contained in App.xaml and its code-behind file, App.xaml.cs. App.xaml is a special XAML file that doesn’t define any visuals, but rather defines an App class that can handle application-level tasks. Usually the only reason to touch this XAML file is to place new application-wide resources, such as custom styles, inside its Application.Resources collection. Chapter 17, “Styles, Templates, and Visual States,” contains many examples of this. Listing 1.4 shows the contents of App.xaml in our HelloRealWorld project.

LISTING 1.4 App.xaml—The Markup for the App Class

<Application   x:Class="HelloRealWorld.App"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.