Anatomy of a WinUI in UWP project
Now that we have a new empty WinUI project loaded in Visual Studio, let's examine the different pieces. In Solution Explorer, you will see two XAML files named App.xaml
and MainPage.xaml
. We will start by discussing the purpose of each of these. Both files can be seen in the following screenshot:
Reviewing App.xaml
The App.xaml
file, as its name implies, stores resources available across an entire application. If you have any templates or styles that will need to be used across multiple pages, they should be added at the Application
level.
The new project's App.xaml
file will contain some markup to start out, as illustrated in the following code snippet:
<Application     x:Class="MyMediaCollection.App"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/   presentation" ...