Convert Figma logo to code with AI

microsoft logoWindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.

3,957
346
3,957
485

Top Related Projects

22,629

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.

116,011

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

169,302

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

A framework for building native applications using React

91,910

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.

Quick Overview

The Microsoft Windows App SDK is a set of libraries and tools that enable developers to build modern, native Windows applications. It provides a unified and consistent development experience across different Windows platforms, including Windows 10, Windows 11, and Windows Server. The SDK aims to simplify the development process and improve the overall quality and performance of Windows applications.

Pros

  • Unified Development Experience: The Windows App SDK offers a consistent and streamlined development experience across various Windows platforms, reducing the complexity of targeting multiple Windows versions.
  • Performance and Efficiency: The SDK is designed to deliver high-performance and efficient applications, leveraging the latest Windows technologies and optimizations.
  • Improved Developer Productivity: The SDK includes a range of tools and libraries that help developers build applications more quickly and with fewer lines of code.
  • Seamless Integration with Windows: The Windows App SDK is tightly integrated with the Windows operating system, allowing developers to take advantage of native Windows features and capabilities.

Cons

  • Limited Backward Compatibility: The Windows App SDK may not provide full backward compatibility with older Windows versions, potentially requiring developers to maintain separate codebases for different Windows platforms.
  • Learning Curve: Developers who are new to the Windows ecosystem may face a steeper learning curve when working with the Windows App SDK, as it introduces new concepts and APIs.
  • Dependency on Windows: The Windows App SDK is inherently tied to the Windows operating system, which may limit the portability of applications built with the SDK to other platforms.
  • Potential Performance Overhead: The use of the Windows App SDK may introduce some performance overhead compared to lower-level Windows APIs, depending on the specific requirements of the application.

Code Examples

Example 1: Creating a Simple Window

using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

// Create a new Window instance
Window window = new Window();

// Set the window title
window.Title = "My Windows App";

// Create a simple content control
ContentControl content = new ContentControl();
content.Content = "Hello, Windows App SDK!";

// Set the window's content
window.Content = content;

// Show the window
window.Activate();

This code demonstrates how to create a simple window using the Windows App SDK, set its title, and add a content control with a message.

Example 2: Handling User Input

using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;

// Create a new Button control
Button button = new Button();
button.Content = "Click me!";

// Add a click event handler
button.Click += Button_Click;

// Add the button to the window's content
window.Content = button;

private void Button_Click(object sender, RoutedEventArgs e)
{
    // Handle the button click event
    MessageDialog dialog = new MessageDialog("You clicked the button!");
    dialog.ShowAsync();
}

This code demonstrates how to create a button, add a click event handler, and display a message dialog when the button is clicked.

Example 3: Using XAML Markup

<Window
    x:Class="MyApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="My Windows App"
    Width="400"
    Height="300">
    <Grid>
        <TextBlock
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            FontSize="24"
            Text="Hello, Windows App SDK!" />
    </Grid>
</Window>

This XAML code creates a window with a centered text block displaying a greeting.

Getting Started

To get started with the Windows App SDK, follow these steps:

  1. Install the Visual Studio IDE, which includes support for the Windows App SDK.
  2. Create a new Windows App SDK project in Visual Studio.
  3. Add the necessary NuGet packages for the Windows App SDK to your project.
  4. Start building your application using the provided APIs and tools.

For more detailed instructions and documentation, please refer to the [Windows App SDK GitHub repository](https://github.com/microsoft/Windows

Competitor Comparisons

22,629

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.

Pros of MAUI

  • Cross-platform development for iOS, Android, macOS, and Windows
  • Single codebase for multiple platforms, reducing development time
  • Leverages existing .NET knowledge for mobile and desktop development

Cons of MAUI

  • Steeper learning curve for developers new to cross-platform development
  • May have performance overhead compared to native development
  • Limited access to platform-specific features without custom renderers

Code Comparison

MAUI:

public class MainPage : ContentPage
{
    public MainPage()
    {
        Content = new StackLayout
        {
            Children = {
                new Label { Text = "Welcome to .NET MAUI!" }
            }
        };
    }
}

WindowsAppSDK:

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();
    }
}

Key Differences

  • MAUI focuses on cross-platform development, while WindowsAppSDK is Windows-specific
  • MAUI uses a single codebase for multiple platforms, WindowsAppSDK is optimized for Windows
  • MAUI has a more abstracted UI approach, WindowsAppSDK provides deeper Windows integration
  • MAUI offers broader platform support, WindowsAppSDK provides more Windows-specific features
  • MAUI may have a larger community due to its cross-platform nature

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.

Pros of Xamarin.Forms

  • Cross-platform development for iOS, Android, and Windows
  • Shared codebase for UI and business logic
  • Large community and extensive third-party library support

Cons of Xamarin.Forms

  • Performance can be slower compared to native development
  • Limited access to platform-specific features
  • Steeper learning curve for developers new to .NET

Code Comparison

Xamarin.Forms:

public class MainPage : ContentPage
{
    public MainPage()
    {
        Content = new StackLayout
        {
            Children = {
                new Label { Text = "Welcome to Xamarin.Forms!" }
            }
        };
    }
}

WindowsAppSDK:

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();
    }

    private void myButton_Click(object sender, RoutedEventArgs e)
    {
        myButton.Content = "Clicked";
    }
}

The code snippets demonstrate the different approaches to creating a simple UI. Xamarin.Forms uses a cross-platform XAML-like syntax, while WindowsAppSDK utilizes WinUI 3 for Windows-specific development.

116,011

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

Pros of Electron

  • Cross-platform development for Windows, macOS, and Linux
  • Large ecosystem with extensive libraries and community support
  • Easier learning curve for web developers

Cons of Electron

  • Larger application size and higher memory usage
  • Performance may be slower compared to native applications
  • Less integration with Windows-specific features

Code Comparison

Electron (JavaScript):

const { app, BrowserWindow } = require('electron')

function createWindow () {
  const win = new BrowserWindow({ width: 800, height: 600 })
  win.loadFile('index.html')
}

app.whenReady().then(createWindow)

WindowsAppSDK (C#):

using Microsoft.UI.Xaml;

public sealed partial class MainWindow : Window
{
    public MainWindow()
    {
        this.InitializeComponent();
    }
}

The Electron code creates a basic window using web technologies, while the WindowsAppSDK code defines a window using XAML and C#. Electron's approach is more familiar to web developers, whereas WindowsAppSDK provides deeper integration with Windows and potentially better performance for Windows-specific applications.

169,302

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

Pros of Flutter

  • Cross-platform development for mobile, web, and desktop from a single codebase
  • Rich set of pre-built widgets and customizable UI elements
  • Hot reload feature for faster development and iteration

Cons of Flutter

  • Larger app size compared to native applications
  • Limited access to platform-specific features without plugins
  • Steeper learning curve for developers new to Dart language

Code Comparison

Flutter:

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(child: Text('Hello, World!')),
    ),
  ));
}

WindowsAppSDK:

using Microsoft.UI.Xaml;

public sealed partial class MainWindow : Window
{
    public MainWindow()
    {
        this.InitializeComponent();
    }
}

Flutter uses Dart and provides a more concise way to create UI elements, while WindowsAppSDK uses C# and XAML for UI design. Flutter's code is more declarative, whereas WindowsAppSDK follows a more traditional object-oriented approach. Flutter's single file can create a complete app, while WindowsAppSDK typically requires separate files for code-behind and XAML.

A framework for building native applications using React

Pros of React Native

  • Cross-platform development for iOS and Android
  • Large and active community with extensive third-party libraries
  • Hot reloading for faster development cycles

Cons of React Native

  • Performance can be slower than native apps for complex UIs
  • Limited access to platform-specific features without native modules
  • Steeper learning curve for developers new to React

Code Comparison

React Native:

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';

const App = () => (
  <View style={styles.container}>
    <Text>Hello, React Native!</Text>
  </View>
);

Windows App SDK:

using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

public sealed partial class MainWindow : Window
{
    public MainWindow()
    {
        this.InitializeComponent();
        this.Content = new TextBlock { Text = "Hello, Windows App SDK!" };
    }
}

The React Native code uses JSX and React components, while the Windows App SDK code uses XAML and C#. React Native's approach is more declarative and JavaScript-based, whereas Windows App SDK follows a more traditional object-oriented programming style typical of Windows development.

91,910

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.

Pros of Tauri

  • Cross-platform support (Windows, macOS, Linux)
  • Smaller app size due to native system components
  • Flexibility in frontend technologies (React, Vue, Svelte, etc.)

Cons of Tauri

  • Less mature ecosystem compared to Windows App SDK
  • Steeper learning curve for developers new to Rust
  • Limited access to some platform-specific features

Code Comparison

Tauri (Rust):

#[tauri::command]
fn greet(name: &str) -> String {
    format!("Hello, {}!", name)
}

Windows App SDK (C#):

public string Greet(string name)
{
    return $"Hello, {name}!";
}

Key Differences

  • Tauri uses Rust for backend logic, while Windows App SDK primarily uses C#
  • Tauri apps can run on multiple platforms, Windows App SDK is Windows-specific
  • Windows App SDK provides deeper integration with Windows features
  • Tauri offers more flexibility in choosing frontend technologies
  • Windows App SDK has a larger, more established ecosystem

Use Cases

Tauri:

  • Cross-platform desktop applications
  • Apps requiring small file sizes
  • Projects with diverse frontend requirements

Windows App SDK:

  • Windows-specific applications
  • Apps leveraging advanced Windows features
  • Projects within the Microsoft ecosystem

Both frameworks offer modern approaches to desktop app development, with Tauri focusing on cross-platform compatibility and Windows App SDK providing deep Windows integration.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Windows App SDK Banner

Windows App SDK

About · Documentation · Release notes · Samples

WindowsAppSDK NuGet

Windows App SDK (formerly Project Reunion) is a set of libraries, frameworks, components, and tools that you can use in your apps to access powerful Windows platform functionality from all kinds of apps on many versions of Windows. The Windows App SDK combines the powers of Win32 native applications alongside modern API usage techniques, so your apps light up everywhere your users are.

  • WinUI 3 support: WinUI embodies Fluent Design to enable intuitive, accessible, and powerful experiences and the latest user interface patterns.
  • Access modern features: Modern resource tooling, modern lifecycle helpers, startup tasks, and more without having to rewrite your app.
  • Backwards compatibility: Down to Windows 10 1809 (build 17763). There may be some API that are dependent on new OS features (like new Action Center functionality), however we will do our best to ensure this is the exception and not the norm, and provide reasonable fallbacks when possible.
  • Wide platform support: Win32, WPF, WinForms, and more.
  • Use your current installer: no requirement to use MSIX, but there are reliability/security benefits to using MSIX.

📋 Getting started with Windows App SDK

👨‍💻 Join in and stay connected

Interested in WinUI and Windows App SDK? Come join us on the quarterly WinUI Community Calls. You can find and tag us on X using #WindowsAppSDK.

🖼️ WinUI 3 Gallery

Make sure to also check out the WinUI 3 Gallery, our interactive sample experience showing everything you can do with WinUI and Windows App SDK.

WinUI 3 Gallery

📢 Contributing

  • File a new issue: Tell us what problem you're trying to solve, how you've tried to solve it so far, and what would be the ideal solution for your app. Bonus points if there's a gist or existing repo we can look at with you.
  • Ask a question: Also, have a look at our FAQ on WinAppSDK page, which we will update periodically.
  • Start a discussion: Let's start a Discussion issue to see if others are interested in a cool new idea you've been thinking about that isn't quite ready to be filed as a more formal Feature Proposal.
  • Code contributions: See our contributing guidelines.

Data collection

This project collects usage data and sends it to Microsoft to help improve our products and services. Note, however, that no data collection is performed when using your private builds.

Privacy information can be found at https://privacy.microsoft.com

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct.

For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.