Files and Samples
Explore the essential files and practical samples that demonstrate the power and flexibility of the Windows App SDK.
Key Project Files
Understanding the structure of a Windows App SDK project is crucial for efficient development. Here are some of the core files you'll encounter:
-
.csproj
(Project File)The project file defines your project's configuration, including target framework, dependencies, and build settings. For Windows App SDK projects, it typically includes references to the SDK packages.
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework> <RootNamespace>MyWinAppSDKApp</RootNamespace> <ApplicationDisplayType>Package </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.x.xxxx" /> <PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.22621.0" /> </ItemGroup> </Project>
-
App.xaml
andApp.xaml.cs
These files define the application's startup logic and resources.
App.xaml
declares application-level resources and the main window, whileApp.xaml.cs
contains the C# code-behind for application initialization and event handling. -
MainWindow.xaml
andMainWindow.xaml.cs
Represents the main window of your application.
MainWindow.xaml
defines the UI layout using XAML, andMainWindow.xaml.cs
contains the C# logic for the window's behavior. -
Package.appxmanifest
This XML manifest file describes the capabilities, identity, and entry points of your packaged application. It's essential for deploying your app to the Microsoft Store or for sideloading.
Sample Applications
Dive into our collection of sample applications to see the Windows App SDK in action. These samples cover various features and scenarios:
Featured Samples:
-
Todo List App
A simple yet comprehensive example showcasing UI development with WinUI, data binding, and basic CRUD operations.
-
Settings UI Sample
Demonstrates how to build a robust settings experience using platform-specific controls and navigation patterns.
-
File Picker Integration
Illustrates how to use the modern Windows file picker APIs to allow users to select files and folders.
-
Background Tasks Sample
Explore how to implement background tasks for efficient resource usage and responsive app behavior.
Finding More Samples:
You can find an extensive repository of Windows App SDK samples on our GitHub repository. These samples are regularly updated and cover a wide range of features and use cases.