📦 UWP and WinUI

Develop modern Windows apps with Universal Windows Platform and WinUI 3 framework.

Modern Windows UI Development

WinUI 3 is the latest native UI framework for Windows desktop applications. It provides the Fluent Design System, modern controls, and excellent performance for Windows 10 and 11 applications.

UWP vs WinUI 3

Getting Started with WinUI 3

Create a new WinUI 3 project using the Windows App SDK:

// App.xaml.cs public partial class App : Application { private Window? m_window; public App() { this.InitializeComponent(); } protected override void OnLaunched(LaunchActivatedEventArgs args) { m_window = new MainWindow(); m_window.Activate(); } }

XAML UI Definition

<!-- MainWindow.xaml --> <Window x:Class="MyApp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <NavigationView x:Name="NavView" IsBackButtonVisible="Collapsed" IsSettingsVisible="True" SelectionChanged="NavView_SelectionChanged"> <NavigationView.MenuItems> <NavigationViewItem Icon="Home" Content="Home" Tag="home"/> <NavigationViewItem Icon="Document" Content="Documents" Tag="docs"/> <NavigationViewItem Icon="Setting" Content="Settings" Tag="settings"/> </NavigationView.MenuItems> <Frame x:Name="ContentFrame"/> </NavigationView> </Window>

Fluent Design Controls

<!-- Modern Input Controls --> <StackPanel Spacing="16"> <TextBox Header="Name" PlaceholderText="Enter your name"/> <ComboBox Header="Country" PlaceholderText="Select"> <ComboBoxItem>France</ComboBoxItem> <ComboBoxItem>Germany</ComboBoxItem> <ComboBoxItem>USA</ComboBoxItem> </ComboBox> <ToggleSwitch Header="Enable notifications" IsOn="True"/> <Slider Header="Volume" Minimum="0" Maximum="100" Value="50"/> <Button Content="Submit" Style="{StaticResource AccentButtonStyle}"/> </StackPanel>

Community Toolkit

The Windows Community Toolkit provides additional controls and helpers:

<!-- Using Community Toolkit --> <toolkit:SettingsCard Header="Appearance" Description="Change how the app looks" HeaderIcon="{ui:SymbolIcon Symbol=Paintbrush}"> <ComboBox SelectedIndex="0"> <ComboBoxItem>Light</ComboBoxItem> <ComboBoxItem>Dark</ComboBoxItem> <ComboBoxItem>System</ComboBoxItem> </ComboBox> </toolkit:SettingsCard>

Migration from UWP

← Back to Developer Resources