Skip to main content
Page #
Building Modern
Windows Desktop
Apps with WinUI 3
June 24 | 1 pm EDT
About ICS
Page 2
We Build Embedded Systems for
What’s Next
Accelerating next-gen product development through
expert engineering and advanced software solutions.
At a Glance
● Founded: 1987
● Headquarters: Waltham, MA (Greater Boston)
● Global Offices: California, Canada, Europe
● Team: 160+ expert engineers & innovators
● Full-stack software development for regulated
& high-reliability industries
Centers of Excellence
● Medtech Software
● Software Development
● AI/ML Innovation
● UX/UI Design & Human Factors
● IoT & Embedded Software
● Cybersecurity
Page 3
● What WinUI 3 is
● What makes it different
● The developer experience
● Live demos
● Converting to WinUI 3
● Wrap-up + Q&A
Agenda
What is WinUI 3?
Page 4
1 2 3
WinUI 3 is…
Microsoft's modern,
native UI framework for
Windows desktop apps
Ships as part of the
Windows App SDK —
decoupled from the OS
The UI layer of a broader
API bundle (windowing,
lifecycle, notifications,
resources)
Page 5
Your language, your choice
● WinUI 3 sits on the WinRT
projection layer — it is not
C#-only
● Write your apps in:
○ C# (via .NET — the most
common path)
○ C++/WinRT
○ Rust/WinRT
Page 6
Why WinUI 3 Exists
● Native performance no web
layer, no Chromium wrapper
● Modern Fluent design language
● Ships independently of
Windows not gated by OS
update cadence
7
Page 7
Page 8
Framework Status Where it fits
WPF Mature, actively maintained Existing investment; not the
target of new UI investment
UWP Maintenance only Sandboxed Store apps;
deprecated for new work
WinUI 3 Active, recommended Modern Windows desktop
native, unsandboxed
MAUI Active Cross-platform (uses WinUI on
Windows under the hood)
Where WinUI 3 Fits in the Microsoft Environment
What Makes WinUI 3 Different
Page 9
Fluent Design System, native:
● Light / Dark modes
● Rounded corners
● Acrylic — translucent material
● Mica — window tinted by the desktop
wallpaper
Your app looks first-party with zero custom
theming.
● Visual Layer — the same composition engine that
draws the Windows shell
● SwapChainPanel — hardware-accelerated DirectX
surfaces
● World-class inking / pen input via direct interop
● MRT Core — Modern Resource Technology: lighter
apps, faster startup, quicker resource lookups
You own the whole window
The Shell’s own graphics engine
● AppWindow APIs — sizing, positioning, snapping
● ExtendsContentIntoTitleBar — blend your own UI
(search, tabs, avatar) straight into the title-bar strip
Windows 11 look and
feel
Page 10
Demo #1:
Theme
Switching themes is a simple one
line change.
Modern, decoupled, web-ready
Page 12
● Ships as a NuGet package (Windows App SDK) not baked into the OS
○ Unlike UWP, new controls and fixes arrive without a Windows update — you upgrade on
your schedule
● WebView2 — embed Chromium web content natively, no performance penalty on the native
shell
○ WinUI itself is native; web content is there when you want it
Modern Controls
● New and improved controls
● Rich Microsoft library built in
○ Pivot
○ Navigation View
○ InfoBar
○ AutoSuggestBox
○ And more
● No more bolt-ons needed
Page 13
Anatomy of a Project
Page 14
A freshly-created WinUI 3 project:
● App.xaml / App.xaml.cs — application entry point and resources
● MainWindow.xaml / MainWindow.xaml.cs — your first window
● Package.appxmanifest — app identity and packaging
● Assets/ — icons and images
The Project Core
Page 15
The XAML mental model
● XAML is object instantiation in markup —
<Button Content="Save"/> ≈ new Button {
Content = "Save" }
● Declarative, not imperative — the nesting
tree is the layout; no new-up-and-add loop
● Markup + code = one partial class, tied
together by x:Class
● InitializeComponent() loads the tree and
wires up the named elements
● x:Name gives you a typed field handle to a
control
● x:Bind — compile-time, type-safe bindings
Page 16
Declarative UI
● The imperative way: new a control, set
properties, add to parent, repeat — layout
only exists after the code runs
● The declarative way: the tree's shape is the
screen, in one place, visible at a glance
● Tooling can render it (Hot Reload)
● A typical app shell: header + nav bar +
content Frame, declared as one tree
○ Pages swap into the Frame; the
header and nav bar (declared outside
it) persist untouched
Page 17
App lifecycle
● App.xaml.cs constructor → OnLaunched →
MainWindow activation
● Work done before InitializeComponent()
matters
○ e.g. set PrimaryLanguageOverride for
locale before init, so x:Uid strings
resolve correctly
Page 18
Demo #2:
MVVM Source Generator
Demo #2: MVVM Source Generator
CommunityToolkit.Mvvm's source generators eliminate all the
INotifyPropertyChanged boilerplate. All of it.
One attribute on a private field [ObservableProperty] and the generator
produces a full public property with change notification and partial
callbacks. One attribute on a method [RelayCommand] and the generator
produces a typed IRelayCommand property exposed to XAML
Page 20
Page 21
WinUI 3 Developer Experience
Open Source & Community Driven
● WinUI 3 is fully open source on GitHub
● Community contributions welcome
● Transparent development roadmap
● Access to source code for debugging and customization
Open ecosystem
Page 22
XAML Hot Reload: Iterate Faster
● Change XAML without restarting the app
● See changes instantly
● Boosts productivity significantly
Real-time UI iteration
Page 23
● CommunityToolkit.Mvvm source
generators
● [ObservableProperty] private string _name;
→ full Name property + change notification
● [RelayCommand] private void Save() { ... } →
SaveCommand exposed to XAML
● The magic word: partial class
x:Bind vs Binding: Binding is runtime reflection that
fails silently; x:Bind is compile-time and faster.
MVVM the modern way
Page 24
Demo #3
Step Rebrand
Demo #3: Step Rebrand
● Rebranding in WinUI 3 is a two-commit operation: first swap raw hex for a
named token ({ThemeResource Brush.Brand.Primary}), then promote
repeated setters into a Style.
● The genuinely WinUI-specific payoff is
ResourceDictionary.ThemeDictionaries: declare Light and Dark variants
once, and the runtime switches every {ThemeResource} lookup
automatically with zero C# code.
Page 26
● Tokens + implicit styles are the XAML platform model shared by WPF,
UWP, Uno, Avalonia
● WinUI 3 adds theme dictionaries
(ResourceDictionary.ThemeDictionaries + ThemeResource)
○ Define your tokens once per theme light, dark, and
high-contrast fall out for free
○ No extra code, no DynamicResource plumbing
● All cleanly packaged up
Page 27
What WinUI adds on top
● ORM: maps .NET classes to database tables, no hand-written SQL
required
● Available for any .NET language C#, F#, VB.NET (not C#-only)
● Code-First: define your model in code, EF generates the schema
from it
● DbContext tracks changes, translates LINQ to SQL, manages the
connection
● I.e. DbSet<Product> = the Products table
● NuGet: Microsoft.EntityFrameworkCore.Sqlite +
Microsoft.EntityFrameworkCore.Tools
Page 28
What is Entity Framework?
● Embedded: Runs in-process, no server to install or configure
● Single file: The entire database is one .db file
● MSIX-friendly: Store in ApplicationData.Current.LocalFolder, survives
package updates
● Official Microsoft package not a third-party add-on
● File doesn't need to exist MigrateAsync() creates it on first launch
Page 29
Why SQLite for a Desktop App?
● Schema lives in your repo and versions with your C# classes
● A few key commands:
○ dotnet ef migrations add <Name>: Generates a migration class
with Up() and Down()
○ dotnet ef database update: Applies pending migrations, creates
the DB if it doesn't exist
○ Call context.Database.MigrateAsync() at app startup to
auto-apply on launch
○ EnsureCreated() skips migrations: Fine for demos, not for
production
Page 30
Migrations: Schema as Code
Demo #4
EF Core + SQLite End to End
1. Define the model and DbContext: one class, one context
2. Dotnet ef migrations add InitialCreate
3. Dotnet ef database update
4. Add a column → second migration → existing data survives
Page 32
Demo #4: EF Core + SQLite End to End
Converting to WinUI 3
Page 33
Page 34
WPF concept WinUI 3 equivalent
Binding (runtime) x:Bind (compile-time)
DataTrigger / Trigger VisualStateManager + behaviors
Dispatcher DispatcherQueue
DataGrid (in-box) CommunityToolkit.WinUI.UI.Controls.
DataGrid (NuGet)
ClickOnce MSIX or unpackaged loose-file
deployment
app.config appsettings.json +
Microsoft.Extensions.Configuration
INotifyPropertyChanged boilerplate CommunityToolkit.Mvvm source
generators
App.OnStartup App.OnLaunched + window activation
How do I convert to WinUI 3?
Wrap Up
Page 35
● Native performance
● Modern Fluent design language
● Ships independently of Windows
● Modern WINUI 3 applications with
community toolkit offer a simple
framework for creating and editing
36
Key Takeaways
Page 36