Convert Figma logo to code with AI

microsoft logomicrosoft-ui-xaml

WinUI: a modern UI framework with a rich set of controls and styles to build dynamic and high-performing Windows applications.

6,619
715
6,619
1,881

Top Related Projects

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

22,629

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

27,472

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.

9,280

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!

Quick Overview

Microsoft UI XAML (WinUI) is an open-source user interface framework for Windows applications. It provides a set of native UI controls and features for building modern, high-performance Windows apps with a consistent, intuitive, and accessible experience.

Pros

  • Offers a rich set of native UI controls and features for Windows applications
  • Supports both UWP and Win32 app development
  • Provides a consistent look and feel across Windows versions
  • Offers excellent performance and accessibility features

Cons

  • Limited to Windows platform development
  • Steeper learning curve compared to some cross-platform alternatives
  • Requires frequent updates to keep up with Windows OS changes
  • Some developers may find the documentation lacking in certain areas

Code Examples

  1. Creating a simple button:
<Button Content="Click me!" Click="Button_Click" />
  1. Implementing a ListView with data binding:
<ListView ItemsSource="{x:Bind Items}">
    <ListView.ItemTemplate>
        <DataTemplate x:DataType="local:Item">
            <TextBlock Text="{x:Bind Name}" />
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>
  1. Using the NavigationView control:
<NavigationView>
    <NavigationView.MenuItems>
        <NavigationViewItem Icon="Home" Content="Home" Tag="home"/>
        <NavigationViewItem Icon="Account" Content="Profile" Tag="profile"/>
        <NavigationViewItem Icon="Settings" Content="Settings" Tag="settings"/>
    </NavigationView.MenuItems>
    <Frame x:Name="ContentFrame"/>
</NavigationView>

Getting Started

  1. Install the WinUI 3 NuGet package in your project:

    Install-Package Microsoft.WinUI -Version 3.0.0
    
  2. Add the WinUI namespace to your XAML file:

    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    
  3. Use WinUI controls in your XAML:

    <muxc:NavigationView>
        <!-- Your navigation items here -->
    </muxc:NavigationView>
    
  4. Build and run your application to see the WinUI controls in action.

Competitor Comparisons

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

Pros of Xamarin.Forms

  • Cross-platform development for iOS, Android, and Windows
  • Single codebase for multiple platforms, reducing development time
  • Extensive library of pre-built UI components

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 ecosystem

Code Comparison

Xamarin.Forms:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyApp.MainPage">
    <StackLayout>
        <Label Text="Welcome to Xamarin.Forms!" />
    </StackLayout>
</ContentPage>

Microsoft UI XAML:

<Page
    x:Class="MyApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <StackPanel>
        <TextBlock Text="Welcome to WinUI!" />
    </StackPanel>
</Page>

Both frameworks use XAML for UI definition, but Xamarin.Forms focuses on cross-platform development, while Microsoft UI XAML is tailored for Windows applications. Xamarin.Forms offers a unified API for multiple platforms, whereas Microsoft UI XAML provides deeper integration with Windows-specific features and controls.

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 .NET 6+ features and performance improvements

Cons of MAUI

  • Steeper learning curve for developers new to cross-platform development
  • Less mature ecosystem compared to WinUI/XAML
  • May have performance overhead on some platforms due to abstraction layer

Code Comparison

MAUI:

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyApp.MainPage">
    <StackLayout>
        <Label Text="Welcome to .NET MAUI!" />
    </StackLayout>
</ContentPage>

Microsoft UI XAML:

<Page
    x:Class="MyApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <StackPanel>
        <TextBlock Text="Welcome to WinUI!" />
    </StackPanel>
</Page>

Summary

MAUI offers cross-platform development with a single codebase, while Microsoft UI XAML focuses on Windows-specific UI development. MAUI provides broader platform support but may have a steeper learning curve and potential performance trade-offs. Microsoft UI XAML offers deeper integration with Windows and potentially better performance for Windows-only applications. The choice between the two depends on the target platforms and specific project requirements.

27,472

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology

Pros of Avalonia

  • Cross-platform support for Windows, macOS, Linux, iOS, Android, and WebAssembly
  • More flexible and customizable UI framework
  • Active community and frequent updates

Cons of Avalonia

  • Smaller ecosystem and fewer third-party controls compared to WinUI
  • Less documentation and learning resources available
  • Potential performance differences on Windows compared to native WinUI

Code Comparison

Avalonia XAML:

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Button Content="Click me!" />
</Window>

WinUI XAML:

<Window
    x:Class="WinUIApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Button Content="Click me!" />
</Window>

Both frameworks use XAML for UI design, but Avalonia's syntax is slightly different and more concise. Avalonia's cross-platform nature allows for a single codebase to target multiple platforms, while WinUI is primarily focused on Windows development. WinUI benefits from tighter integration with the Windows ecosystem and potentially better performance on Windows, but Avalonia offers greater flexibility for cross-platform development.

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.

Pros of ReactiveUI

  • Cross-platform support for various .NET platforms (Xamarin, WPF, UWP, etc.)
  • Reactive programming model for better handling of asynchronous operations
  • Extensive community support and active development

Cons of ReactiveUI

  • Steeper learning curve due to reactive programming concepts
  • Potentially more complex codebase for simple applications
  • Less direct integration with native UI controls compared to WinUI

Code Comparison

ReactiveUI:

this.WhenAnyValue(x => x.SearchTerm)
    .Throttle(TimeSpan.FromSeconds(0.8))
    .SelectMany(term => SearchService.Search(term))
    .ObserveOn(RxApp.MainThreadScheduler)
    .ToProperty(this, x => x.SearchResults, out _searchResults);

WinUI (microsoft-ui-xaml):

private async void SearchBox_TextChanged(object sender, TextChangedEventArgs e)
{
    var searchTerm = ((TextBox)sender).Text;
    var results = await SearchService.Search(searchTerm);
    SearchResultsListView.ItemsSource = results;
}

The ReactiveUI example demonstrates reactive programming for search functionality, while the WinUI example shows a more traditional event-based approach. ReactiveUI offers more concise and declarative code for complex scenarios, but may be overkill for simpler use cases where WinUI's straightforward approach suffices.

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.

Pros of WindowsCommunityToolkit

  • Broader range of controls and helpers for various Windows development scenarios
  • More frequent updates and contributions from the community
  • Includes additional features like notifications, animations, and extensions

Cons of WindowsCommunityToolkit

  • Larger package size due to the extensive set of features
  • May include unnecessary components for specific projects
  • Potential for more breaking changes due to frequent updates

Code Comparison

WindowsCommunityToolkit:

using Microsoft.Toolkit.Uwp.UI.Controls;

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();
        var adaptiveGridView = new AdaptiveGridView();
    }
}

microsoft-ui-xaml:

using Microsoft.UI.Xaml.Controls;

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();
        var itemsRepeater = new ItemsRepeater();
    }
}

The code comparison shows that both libraries provide custom controls, but WindowsCommunityToolkit offers a wider variety of specialized controls like AdaptiveGridView, while microsoft-ui-xaml focuses on core UI components like ItemsRepeater.

9,280

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!

Pros of Uno

  • Cross-platform development for multiple operating systems (iOS, Android, WebAssembly, macOS, Linux)
  • Allows reuse of existing XAML and C# skills for multi-platform development
  • Active community and frequent updates

Cons of Uno

  • Steeper learning curve for developers new to XAML
  • May have performance overhead compared to native platform development
  • Limited third-party control support compared to WinUI

Code Comparison

microsoft-ui-xaml:

<Page
    x:Class="App1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <TextBlock Text="Hello, World!" />
    </Grid>
</Page>

Uno:

<Page
    x:Class="App1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid>
        <TextBlock Text="Hello, World!" />
    </Grid>
</Page>

The XAML code is nearly identical for both platforms, showcasing Uno's ability to leverage existing WinUI/UWP skills for cross-platform development. The main difference lies in the underlying implementation and platform-specific adaptations made by Uno to achieve cross-platform compatibility.

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

WinUI hero image

WinUI 3

Follow @windowsui

About WinUI · Documentation · Release notes

WinUI is a user interface layer that contains modern controls and styles for building Windows apps. The current generation is WinUI 3, which ships as part of the Windows App SDK.

  • Modern UI: WinUI embodies Fluent Design to enable intuitive, accessible, and powerful experiences and the latest user interface patterns.
  • Developers in control: Use .NET with C# or C++ to write apps that run great on x86, x64 and ARM.
  • Optimized for modern experiences & hardware: Create performant experiences with WinUI that are optimized for modern hardware.
  • Part of the Windows App SDK: The Windows App SDK 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.
  • Powers key experiences in Windows: Windows experiences and apps are built with WinUI. Its rich control set and styles make it easy to develop high-quality experiences used by millions every day.

Powers key experiences in Windows

📋 Getting started with WinUI

For WinUI, your app's users must be on Windows 10 1809 - Build 17763 or newer (including Windows Insider Previews).

The full documentation of WinUI can be found on Microsoft Learn:


🖼️ WinUI 3 Gallery

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

WinUI 3 Gallery


📺 WinUI Community Call

The WinUI Community Call is your opportunity to learn about WinUI and to engage with the WinUI team and community. Join us online on YouTube at the Windows Developer channel.


📢 Contributing to WinUI

The WinUI team welcomes your feedback! To understand how we handle incoming feature requests and bugs, please see our contribution handling guidelines.

For information on how to contribute, please see Contributing to WinUI.


🛣️ Roadmap

For info on the WinUI release schedule and high level plans please see the WinUI roadmap.


🔧 WinUI 2 (for UWP)

WinUI 2 is a library of controls that provides Microsoft UI controls and features for UWP apps. Learn more about WinUI 2 here or download the source code here.

You can get the WinUI 2 Gallery on the Microsoft Store and see the source code here.

Data/Telemetry

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.

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.