Skip to sessions and notes

These session notes are AI-generated and may contain mistakes. Verify important details against the original recording.

Building great Windows apps with WinUI and agents

Niels Laute, Morten Nielsen

Session · 25:07 recording · 8 min read

At a glance

  • WinUI 3 open source single source of truth (microsoft/microsoft-ui-xaml)
  • New native controls: experimental TableView (virtualized, sorting, column toggles), Charting, Pen & Ink
  • Five investment pillars: Open Source, Controls, Performance, Core APIs, Developer Experience
  • WinAppCLI (winapp on winget): cross-framework CLI (WinUI, WPF, WinForms, Electron, Tauri)
  • VS Code WinApp extension: full IntelliSense, run, debug with auto launch configs

Executive Summary

At .NET Conf 2026, Niels Laute and Morten Nielsen presented a transformative update for Windows desktop development: modernizing WinUI 3 as part of the Windows App SDK and deeply integrating autonomous AI coding agents into the developer loop.

WinUI is Microsoft's native UI framework powering critical Windows 11 system experiences (Photos, Notepad, Paint, Widgets, Windows Search, and the newly overhauled Run dialog). In 2026, Microsoft is doubling down on five core pillars: open source transparency on GitHub (microsoft/microsoft-ui-xaml), new native controls (Charting, experimental TableView, Pen & Ink), hardcore performance optimizations (windowing and XAML compiler), core modern APIs shipped monthly independent of the OS, and developer tooling parity.

Crucially, the session demonstrated how to equip AI coding agents (such as GitHub Copilot, Claude Code, or Codex) with both "Hands" (via the cross-framework WinAppCLI and isolated Windows Sandbox execution) and "Knowledge" (via official WinUI Copilot plugins and skills grounded in the WinUI Gallery). Developers can now annotate running applications with interactive UI comments saved directly to .winapp/comments.json, command an agent to inspect, iterate, and verify UI changes headlessly inside Windows Sandbox, leverage on-device NPUs via the Windows App SDK AI APIs, and use winapp perf profiling to autonomously diagnose startup latency and visual tree rendering bottlenecks.


1. WinUI Architecture & Ecosystem Overview

Title: Building Great Windows Apps with WinUI and Agents
Title: Building Great Windows Apps with WinUI and Agents

What is WinUI?

WinUI is Microsoft's modern native UI framework for building graphical Windows applications. It delivers:

  • Fluent Design System controls out of the box with native Windows 11 styling, elevation, animations, and typography.
  • Polyglot flexibility: High-performance development in C# (.NET 11) or C++ with declarative XAML layout.
  • Hardware Acceleration: DirectX GPU-accelerated rendering, high-DPI scaling, and native input support across mouse, keyboard, touch, pen inking, and game controllers with built-in accessibility.
  • Windows App SDK Decoupling: Distributed out-of-band via NuGet, decoupling modern capabilities (app lifecycle, system notifications, widgets, on-device local AI) from annual Windows OS upgrades.

WinUI Architecture Overview
WinUI Architecture Overview

Windows 11 Experiences Built on WinUI
Windows 11 Experiences Built on WinUI

flowchart TD
    subgraph AppLayer["Application Layer"]
        AppCS["C# / .NET 11 Applications"]
        AppCPP["C++ Native Applications"]
        AppHybrid["React Native / Hybrid Shells"]
    end

    subgraph WinAppSDK["Windows App SDK (NuGet / Monthly Cadence)"]
        WinUI3["WinUI 3 (Controls, XAML Engine, Composition)"]
        Controls["New Controls: TableView, Charting, Inking"]
        WinAI["Windows App SDK AI APIs (On-Device NPU / Copilot+ PC)"]
        PlatformAPIs["Windowing, Notifications, Lifecycle, Widgets"]
    end

    subgraph ToolingLayer["Developer & Agent Toolchain"]
        WinAppCLI["WinAppCLI ('winapp' via winget)"]
        VSCodeExt["VS Code WinApp Extension"]
        VSExt["Visual Studio 2026 (Templates & XAML Previewer)"]
        Sandbox["Windows Sandbox (Isolated Background Agent Runs)"]
    end

    AppLayer --> WinAppSDK
    ToolingLayer --> AppLayer

2. Five Big Investment Pillars in WinUI

Five WinUI Investment Pillars
Five WinUI Investment Pillars

Microsoft highlighted five primary investment areas guiding the ongoing evolution of WinUI:

  1. Open Source Source-of-Truth: The public GitHub repository (microsoft/microsoft-ui-xaml) is now the authoritative internal working tree, allowing the community to track daily commits, triage papercuts, and preview experimental branches.
  2. Expanding Native Control Suite: Introducing production and experimental controls requested by desktop developers:
    • TableView (Experimental): High-density columnar data presentation with column reordering, sorting, column visibility toggles, and virtualization.
    • Charting Controls: Native high-frequency visualization without relying on unmaintained third-party dependencies.
    • Pen & Ink: Low-latency hardware inking capabilities integrated into modern XAML containers.
  3. Core Performance: Deep architectural profiling on startup cold boots, memory footprint, and rendering passes in CoreCLR and XAML compiler pipelines.
  4. Core APIs & Windowing: Simplifying multi-window management, custom title bars, full mica/acrylic backdrop configuration, and XAML compiler optimizations.
  5. Modern Developer Experience: Meeting developers where they choose to work across Visual Studio, VS Code, and terminal CLI workflows.

3. Developer Tooling Parity: CLI, VS Code, and Visual Studio

Developer Experience Tools
Developer Experience Tools

WinAppCLI (winapp)

Installed via Windows Package Manager (winget install winapp), the new CLI provides unified commands across WinUI, WPF, WinForms, Electron, and Tauri:

# Install WinApp CLI
winget install winapp

# Create a new WinUI 3 Navigation View application
dotnet new winui-app -n WinAppTracker -f net11.0 -p:Packaged=false

# Run application with in-app developer tools enabled
winapp run

# Execute automated performance profiling
winapp perf record --duration 10s
winapp perf analyze

.NET New WinUI Templates with Packaged Toggle
.NET New WinUI Templates with Packaged Toggle

First-Class Packaged vs Unpackaged Toggle

A frequent friction point has been configuring MSIX packaging versus loose unpackaged deployment. In .NET 11, the project templates natively incorporate a -p:Packaged=false flag in CLI and a direct project wizard toggle in Visual Studio:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net11.0-windows10.0.19041.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
    <RootNamespace>WinAppTracker</RootNamespace>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <!-- Out-of-the-box unpackaged execution toggle -->
    <WindowsPackageType>None</WindowsPackageType>
    <UseWinUI>true</UseWinUI>
  </PropertyGroup>
</Project>

4. Agentic Windows App Development: Hands and Knowledge

Agentic Development: Hands and Knowledge
Agentic Development: Hands and Knowledge

Giving Agents "Hands"

To enable AI coding agents to autonomously develop and test desktop user interfaces, Microsoft built automation and inspection primitives into WinAppCLI:

  • Run & Debug Control: Agents can invoke winapp run, launch debugger sessions, and terminate processes safely.
  • Visual Tree Inspection: Agents extract live UI element hierarchies, accessibility properties, and bounding boxes.
  • Windows Sandbox Integration: Agents deploy and execute the application inside an isolated Windows Sandbox container. This prevents the agent from stealing mouse focus, moving the cursor, or interfering with user productivity while it runs automated click tests and navigates UI pages.

Giving Agents "Knowledge"

Copilot plugins and domain skills provide structured WinUI grounding:

  • find-ui: Queries WinUI Gallery samples and official design guidelines to ensure correct control usage (e.g., using Expander or NavigationView rather than custom re-inventions).
  • winui-design: Guides spacing, elevation, tokenized typography, and Fluent styling.
  • winui-performance: Advises on data virtualization, asynchronous loading, and lightweight visual trees.

5. In-App DevTools & Live UI Comments (comments.json)

WinApp Run DevTools Overlay and Live Comments
WinApp Run DevTools Overlay and Live Comments

When running via winapp run, an unobtrusive overlay toolbar appears over the application window providing:

  1. Dark / Light Theme Toggle: Instant live preview without restarting the app or modifying Windows system theme settings.
  2. Element Inspector: Hover and click to inspect XAML layout properties, margins, paddings, and data-bound contexts.
  3. Interactive UI Comments: Developers can click anywhere on the UI to place a comment pin (e.g., "Change title to Welcome to .NET Conf", "Add last 7 days of closed GitHub issues").

Copilot Reading .winapp/comments.json
Copilot Reading .winapp/comments.json

Comments are saved directly into the workspace at .winapp/comments.json:

{
  "comments": [
    {
      "id": "c1092a",
      "targetElement": "HeaderTextBlock",
      "instruction": "Welcome to .NET Conf",
      "status": "open",
      "page": "IssuesPage.xaml"
    }
  ]
}

An agent invoked with copilot or terminal CLI reads .winapp/comments.json, locates the corresponding XAML and C# files, modifies the code, launches the app in Windows Sandbox to verify the UI change, and marks the comment resolved.

Agent Testing UI in Windows Sandbox
Agent Testing UI in Windows Sandbox


6. On-Device AI via Windows App SDK & Local NPU

On-Device AI via Copilot Runtime on NPU
On-Device AI via Copilot Runtime on NPU

Morten demonstrated extending the GitHub issue tracker application with on-device AI running directly on the local NPU of a Copilot+ PC using the Windows App SDK AI APIs:

// Using Windows App SDK On-Device AI APIs
using Microsoft.Windows.AI.Generative;

public async Task<string> SummarizeUnreadCommentsAsync(string commentsThread)
{
    // Initialize local on-device language model running on NPU
    using var model = await LanguageModel.CreateAsync();
    
    var prompt = $"""
        You are a desktop assistant. Summarize the following GitHub comment thread 
        focusing on action items and unread decisions:
        {commentsThread}
        """;
        
    var response = await model.GenerateResponseAsync(prompt);
    return response.Text;
}

The app also uses local AI to translate plain English user queries ("give me the latest seven days of closed issues in the WinUI repo") into structured GitHub REST/GraphQL search queries bound directly to the experimental TableView control.


7. Performance Profiling with winapp perf

WinApp Perf Profiling and Bottleneck Diagnosis
WinApp Perf Profiling and Bottleneck Diagnosis

When startup delays or UI hitching occur, developers can run winapp perf:

  1. The CLI records an ETW performance trace during application startup and interaction.
  2. The agent reads the trace report via winapp perf analyze.
  3. In the live demo, the trace revealed that while a frame took 1.5 seconds, only ~30% was spent in XAML composition; the rest was synchronous file and network I/O blocking the UI thread.
  4. The agent automatically restructured data fetching to run asynchronously and implemented delay loading, cutting startup time in half.

8. Visual Studio Sneak Peek: Modern XAML Previewer

Sneak Peek: Visual Studio XAML Previewer
Sneak Peek: Visual Studio XAML Previewer

The session concluded with an exclusive sneak peek of an experimental interactive XAML Previewer in Visual Studio 2026:

  • Side-by-side live rendering with bi-directional element selection.
  • Responsive design drag handles allowing developers to test custom window widths and heights.
  • Instant dark/light mode toggles within the preview surface.
  • Integrated MTP (Microsoft Testing Platform) unit test template supporting AOT compilation and asynchronous UI test execution.

Key Session Takeaways

Feature / Investment Capability / Benefit
GitHub Open Source microsoft/microsoft-ui-xaml is now the single source of truth; transparent monthly cadence.
New Native Controls Experimental TableView (sorting, column toggles), native Charting, and low-latency Pen & Ink.
WinAppCLI (winapp) Cross-framework Windows CLI on winget: create, build, run with DevTools, inspect, and profile.
Agentic Windows Dev Hands (WinAppCLI, Windows Sandbox headless runs) + Knowledge (WinUI Copilot plugin, Gallery grounding).
In-App DevTools Live dark mode switch, property inspector, and interactive .winapp/comments.json pin workflows.
On-Device AI APIs Windows App SDK local NPU execution for summarization and natural language search query generation.
XAML Previewer Modern interactive previewer in Visual Studio with theme toggles and responsive sizing handles.