Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added hub/apps/develop/ai-assisted/images/arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions hub/apps/develop/ai-assisted/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
title: AI-assisted Windows development
description: Build Windows apps faster using AI agents, GitHub Copilot, Claude Code, and the Windows AI development toolkit — with tools that are free, work in VS Code, and require no prior Windows experience.
ms.topic: overview
ms.date: 05/13/2026
ms.author: jken
author: GrantMeStrength
---

# AI-assisted Windows development

Windows has a complete set of free, AI-ready tools that take you from idea to published app — entirely from the command line or VS Code, without needing Visual Studio. Whether you're building a new app from scratch or modernizing one you wrote years ago, AI agents can do the heavy lifting.

:::image type="content" source="images/arch.png" alt-text="Architecture diagram showing a developer writing prompts into VS Code, where GitHub Copilot and Claude Code AI agents use the WinUI Agent Plugin and winui-ui-testing skill from the Knowledge Layer, and query the Microsoft Learn MCP Server for live API docs, to generate correct WinUI 3 code targeting the Windows App SDK and .NET 10.":::

> [!TIP]
> New to Windows development? Start with the [Quickstart: Build and publish a Windows app with AI](quickstart.md) — you can have a working app in under 30 minutes using only free tools.

---

## What path are you on?

:::row:::
:::column:::
### I'm starting fresh
Use the `winui-dev` agent and `dotnet new` templates to scaffold, build, run, and publish a new Windows app — no Windows experience required.

→ [Quickstart](quickstart.md)
→ [WinUI agent plugin](winui-agent-plugin.md)
:::column-end:::
:::column:::
### I have an existing app
AI tools can help you migrate WPF, WinForms, or UWP apps to modern WinUI 3, or add Windows capabilities to apps built with Electron, Flutter, Tauri, or Rust.

→ [Migrate from WPF](migrate/wpf-to-winui.md)
→ [Migrate from UWP](migrate/uwp-to-winui.md)
→ [Cross-framework apps](migrate/cross-framework.md)
:::column-end:::
:::row-end:::

---

## Tools in this section

| Tool | What it does |
|------|-------------|
| **[WinUI agent plugin](winui-agent-plugin.md)** | 8 skills for end-to-end WinUI development in GitHub Copilot or Claude Code |
| **[VS Code tools](vs-code-tools.md)** | WinApp extension + Microsoft Learn MCP Server for VS Code and Claude Code |
| **[AI-assisted testing](testing.md)** | Generate and run UI tests using Windows UI Automation |
| **[Publish to the Store](quickstart.md#step-5-publish-to-the-microsoft-store)** | Submit to the Microsoft Store from the command line using `winapp store` |

---

## Frequently asked questions

### Can I build a WinUI 3 app without Visual Studio?

Yes. Three commands are all you need:

```powershell
dotnet new winui-navview -n MyApp
cd MyApp
dotnet run
```

Build, debug, package, and publish from VS Code or the terminal. Visual Studio is still best for complex XAML debugging, but it's no longer required. See the [Quickstart](quickstart.md).

### Are these tools free?

Yes — the WinApp CLI, VS Code extension, and `dotnet new` templates are free and open source. GitHub Copilot requires a [subscription](https://github.com/features/copilot) (free tier available). The [Microsoft Learn MCP Server](vs-code-tools.md#microsoft-learn-mcp-server) is free with no sign-in required.

### Will Copilot give me outdated UWP code instead of WinUI 3?

By default, yes. AI models have more UWP training data than WinUI 3, so they drift toward deprecated patterns (`Windows.UI.Xaml`, `CoreDispatcher`, `MessageDialog`). Two tools fix this: the [WinUI agent plugin](winui-agent-plugin.md) injects correct WinUI 3 rules as custom instructions, and the [Microsoft Learn MCP Server](vs-code-tools.md#microsoft-learn-mcp-server) gives your agent live access to current docs.

### Does this work with Claude Code as well as GitHub Copilot?

Yes. The `winui@awesome-copilot` plugin and the Microsoft Learn MCP Server both work with any MCP-compatible agent.

### How long does it take to go from idea to published app?

Under 30 minutes to a running app (see the [Quickstart](quickstart.md)). Store submission requires a [Partner Center account](https://partner.microsoft.com/dashboard) and certification, which typically takes 1–3 business days.

---

## Starter prompts

AI models have years of UWP and WPF training data — these prompts override that and anchor responses to current WinUI 3 patterns.

> [!TIP]
> To avoid adding these WinUI 3 constraints to every prompt, install the [WinUI agent plugin](winui-agent-plugin.md). It injects them automatically as system-level instructions, so you can write simple requests like *"Build me a WinUI 3 app that shows files in a folder"* without spelling out the API rules each time.

### New app

```
Create a new WinUI 3 Windows app using `dotnet new winui-navview` (from the
Microsoft.WindowsAppSDK.WinUI.CSharp.Templates package). Build and run with the
winapp CLI — not Visual Studio.

Use Microsoft.UI.Xaml for all controls — never Windows.UI.Xaml.
Use DispatcherQueue, not CoreDispatcher.
Use AppWindow + OverlappedPresenter, not ApplicationView.
Use ContentDialog, not MessageDialog.
```

### Migrate from UWP or WPF

```
I'm migrating a [UWP / WPF] app to WinUI 3 using the Windows App SDK.

Apply these substitutions:
- Windows.UI.Xaml.* → Microsoft.UI.Xaml.*
- CoreDispatcher / Dispatcher.RunAsync → DispatcherQueue.TryEnqueue
- ApplicationView → AppWindow + OverlappedPresenter
- MessageDialog → ContentDialog
- Windows.UI.Notifications → Microsoft.Windows.AppNotifications
- Frame.Navigate with UWP page types → WinUI 3 Frame + Page

Do not introduce any Windows.UI.* APIs. Flag anything without a direct WinUI 3 equivalent.
```

### Add a feature to an existing WinUI 3 app

```
This is a WinUI 3 app using the Windows App SDK.
- Use Microsoft.UI.Xaml.* namespaces only
- Use DispatcherQueue for thread marshalling
- Use CommunityToolkit.Mvvm for MVVM patterns
- Use winapp run to test — do not open Visual Studio
```

---

## Related content

- [Windows App Development CLI](../../dev-tools/winapp-cli/index.md)
- [Security and responsible AI](security-and-responsible-ai.md)
70 changes: 70 additions & 0 deletions hub/apps/develop/ai-assisted/migrate/cross-framework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: "Cross-framework app considerations"
description: Build Windows apps that share business logic across WinUI 3, MAUI, and other frameworks using the Windows App SDK.
ms.topic: overview
ms.date: 05/13/2026
ms.author: jken
author: GrantMeStrength
---

# Cross-framework app considerations

You may be coming to WinUI 3 from React Native Windows, Electron, Flutter, or .NET MAUI. This page covers what to expect when targeting WinUI 3 specifically, and how to set up your AI agent for success.

The key decision: do you want to keep a cross-platform shell, or build a Windows-first app? Give your AI agent a clear boundary — which business logic stays shared, and which UI should be rewritten as native WinUI 3.

## React Native for Windows

React Native for Windows uses a WinUI rendering layer under the hood. You can integrate native Windows controls through `<WindowsXamlView>` or NativeModules.

For a fully native Windows experience, porting directly to WinUI 3 gives better performance and full Windows API access. Keep business logic and services, but rewrite UI components as XAML and C#.

Starter prompt:
```text
I have a React Native for Windows component. Rewrite it as a WinUI 3 UserControl using C# and XAML.
```

## Electron

Electron apps are web technology wrapped in a shell; WinUI 3 is native Win32. A practical incremental path is to host your existing web UI in a WinUI 3 window using WebView2, then migrate features to native controls over time.

Starter prompt:
```text
I have an Electron app. Create a WinUI 3 shell that hosts a WebView2, and show me how to call native Windows APIs from the web layer using window.chrome.webview.postMessage.
```

## .NET MAUI

.NET MAUI already targets Windows via WinUI 3. If you want a Windows-only experience with full WinUI 3 control, remove MAUI and target WinUI 3 directly.

- ViewModels and services move across cleanly
- MAUI XAML (`Microsoft.Maui.Controls.*`) needs rewriting to WinUI 3 XAML (`Microsoft.UI.Xaml.*`)
- Keep shared .NET class libraries as-is

Starter prompt:
```text
I have a .NET MAUI ViewModel and service layer. Reuse them in a WinUI 3 project targeting Windows only. Keep the ViewModel unchanged and update only the View.
```

## Flutter

Flutter for Windows uses its own rendering engine, not WinUI 3. Platform channels let Flutter call native Win32 or WinRT APIs, but a full port replaces Flutter rendering with native XAML.

Starter prompt:
```text
I have a Flutter screen with a list and a detail view. Rewrite it as a WinUI 3 page using NavigationView and a master/detail layout.
```

## Sharing code across platforms

- Keep business logic in a separate .NET class library — it's platform-agnostic
- Share that library between WinUI 3, MAUI, Blazor, or any other .NET target
- Reuse models, services, and ViewModels before rewriting UI
- Use `#if WINDOWS` conditional compilation only as a last resort

## Related content

- [Migrate and port apps overview](index.md)
- [Migrate from WPF](wpf-to-winui.md)
- [Migrate from UWP](uwp-to-winui.md)
- [Migrate from iOS](ios-to-winui.md)
36 changes: 36 additions & 0 deletions hub/apps/develop/ai-assisted/migrate/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: "Migrate and port apps to WinUI 3"
description: Modernize existing Windows apps by migrating from WPF, UWP, or other frameworks to WinUI 3 and the Windows App SDK using AI assistance.
ms.topic: overview
ms.date: 05/13/2026
ms.author: jken
author: GrantMeStrength
---

# Migrate and port apps to WinUI 3

WinUI 3 and the Windows App SDK are the modern foundation for Windows apps. AI tools can automate much of the mechanical migration work — namespace substitutions, API replacements, project file updates — but they need accurate guidance to avoid reproducing outdated patterns.

The main risk is drift toward older stacks. AI models have more training data for UWP and WPF than for WinUI 3, so provide exact API mappings when prompting for migration code.

## Choose your migration path

| From | To | AI skill | Guide |
|------|----|----------|-------|
| WPF (.NET) | WinUI 3 | `winui-wpf-migration` | [Migrate from WPF](wpf-to-winui.md) |
| UWP | WinUI 3 | — | [Migrate from UWP](uwp-to-winui.md) |
| iOS / SwiftUI | WinUI 3 | — | [Migrate from iOS](ios-to-winui.md) |
| React Native / Electron / MAUI / Flutter | WinUI 3 | — | [Cross-framework considerations](cross-framework.md) |

## Before you start

- Work in a branch before running large AI-assisted rewrites.
- Verify your dependencies support .NET 10 and Windows App SDK packaging.
- Review the [Windows App SDK migration guide](https://learn.microsoft.com/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/migrate-to-windows-app-sdk-ovw).
- Prepare API mapping tables before prompting — the per-framework pages have them ready to paste.

## Related content

- [AI-assisted development overview](../index.md)
- [Quickstart: Build and publish a Windows app with AI](../quickstart.md)
- [WinUI agent plugin](../winui-agent-plugin.md)
82 changes: 82 additions & 0 deletions hub/apps/develop/ai-assisted/migrate/ios-to-winui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Migrate an iOS app to WinUI 3
description: Use AI assistance to port an iOS app to WinUI 3 and the Windows App SDK — mapping UIKit concepts, Swift patterns, and iOS lifecycle events to their WinUI equivalents.
ms.topic: how-to
ms.date: 05/14/2026
ms.author: jken
author: GrantMeStrength
---

# Migrate an iOS app to WinUI 3

If you have an iOS app and want to bring it to Windows, AI tools can do most of the mapping work. This page provides the key concept translations from UIKit/SwiftUI to WinUI 3. Use these tables as context when prompting your AI agent — providing exact API mappings up front produces far more accurate output than asking for a generic conversion.

Install the [WinUI agent plugin](../winui-agent-plugin.md) first to give your agent accurate WinUI 3 knowledge:

```powershell
gh copilot plugin install winui@awesome-copilot
```

## Concept mapping

| iOS (UIKit / SwiftUI) | WinUI 3 equivalent | Notes |
|---|---|---|
| `UIViewController` | `Page` | WinUI pages are navigated via `Frame` |
| `UINavigationController` | `Frame` + `NavigationView` | Use `Frame.Navigate()` for page transitions |
| `UITabBarController` | `NavigationView` (top or left tabs) | |
| `UITableView` | `ListView` | Use `ObservableCollection<T>` for data binding |
| `UICollectionView` | `GridView` | |
| `UIAlertController` | `ContentDialog` | Must be parented to the current `XamlRoot` |
| `UILabel` | `TextBlock` | |
| `UITextField` | `TextBox` | |
| `UIButton` | `Button` | |
| `UIImageView` | `Image` | |
| `UIStackView` | `StackPanel` | Set `Orientation` to `Horizontal` or `Vertical` |
| `Auto Layout` | `Grid` / `StackPanel` / `RelativePanel` | XAML layout is row/column based |
| `@State` / `@Binding` (SwiftUI) | `INotifyPropertyChanged` / `ObservableProperty` (CommunityToolkit.Mvvm) | |
| `NSUserDefaults` | `ApplicationData.Current.LocalSettings` | |
| `URLSession` | `HttpClient` | Use `System.Net.Http.HttpClient` |
| `NotificationCenter` | Events or `WeakReferenceMessenger` (CommunityToolkit.Mvvm) | |
| `DispatchQueue.main.async` | `DispatcherQueue.TryEnqueue` | |
| `AppDelegate.applicationDidFinishLaunching` | `App.OnLaunched` | |
| `SceneDelegate` / `windowScene` | `MainWindow` / `AppWindow` | |
| `FileManager` | `StorageFolder` / `StorageFile` | |
| `UserNotifications` | `AppNotificationManager` (Microsoft.Windows.AppNotifications) | |

## Starter prompt

Use this prompt to give your AI agent the context it needs before starting a migration:

```
I'm migrating an iOS app to WinUI 3 using the Windows App SDK.

The app is written in [Swift / Objective-C] using [UIKit / SwiftUI].

Apply these mappings:
- UIViewController → Page, navigated via Frame
- UINavigationController → Frame + NavigationView
- UITableView → ListView with ObservableCollection<T>
- UIAlertController → ContentDialog (parented to XamlRoot)
- NSUserDefaults → ApplicationData.Current.LocalSettings
- URLSession → System.Net.Http.HttpClient
- DispatchQueue.main.async → DispatcherQueue.TryEnqueue
- @State / @Binding → INotifyPropertyChanged via CommunityToolkit.Mvvm

Use Microsoft.UI.Xaml.* namespaces throughout — never Windows.UI.Xaml.*.
Generate C# — not Swift.
```

## What doesn't map directly

Some iOS concepts don't have a direct WinUI equivalent:

- **In-app purchases**: Use the [Microsoft Store commerce APIs](https://learn.microsoft.com/windows/uwp/monetize/) via `Windows.Services.Store`
- **Push notifications (APNs)**: Use [Windows Push Notification Services (WNS)](../../notifications/push-notifications/wns-overview.md)
- **HealthKit / ARKit / CoreML**: Windows has related technology areas — [Windows ML](https://learn.microsoft.com/windows/ai/windows-ml/), [Windows Mixed Reality](https://learn.microsoft.com/windows/mixed-reality/), and [Windows Sensors](https://learn.microsoft.com/windows/uwp/devices-sensors/sensors) — but these are not direct equivalents and require platform-specific implementation
- **App Clips**: No direct equivalent — consider [web-to-app linking](https://learn.microsoft.com/windows/uwp/launch-resume/web-to-app-linking)

## Related content

- [Migrate from UWP](uwp-to-winui.md)
- [WinUI agent plugin](../winui-agent-plugin.md)
- [Microsoft Learn MCP Server](../vs-code-tools.md#microsoft-learn-mcp-server)
Loading