Convert Figma logo to code with AI

CommunityToolkit logoWindowsCommunityToolkit

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.

5,960
1,376
5,960
319

Top Related Projects

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

This app demonstrates the controls available in WinUI and the Fluent Design System.

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.

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.

Telerik UI for Universal Windows Platform (UWP) is no longer supported.

Quick Overview

The Windows Community Toolkit is an open-source collection of helper functions, custom controls, and app services designed to simplify and demonstrate common developer tasks for building UWP, WPF, and WinUI applications for Windows. It provides a comprehensive set of controls and APIs to enhance Windows app development.

Pros

  • Extensive collection of ready-to-use controls and helpers
  • Regularly updated and maintained by Microsoft and the community
  • Supports multiple Windows app platforms (UWP, WPF, WinUI)
  • Well-documented with samples and API references

Cons

  • Learning curve for developers new to Windows app development
  • Some components may have platform-specific limitations
  • Occasional breaking changes between major versions
  • Dependency on Windows-specific technologies limits cross-platform use

Code Examples

  1. Using the Adaptive Grid View control:
<controls:AdaptiveGridView
    ItemHeight="200"
    DesiredWidth="300"
    ItemsSource="{x:Bind Items}">
    <controls:AdaptiveGridView.ItemTemplate>
        <DataTemplate>
            <Image Source="{Binding Thumbnail}" Stretch="UniformToFill"/>
        </DataTemplate>
    </controls:AdaptiveGridView.ItemTemplate>
</controls:AdaptiveGridView>
  1. Implementing the InAppNotification control:
<controls:InAppNotification x:Name="Notification" />

// In code-behind
Notification.Show("Hello World!", 3000);
  1. Using the ImageEx control for advanced image loading:
<controls:ImageEx Source="ms-appx:///Assets/Logo.png"
                  PlaceholderSource="ms-appx:///Assets/PlaceholderImage.png"
                  IsCacheEnabled="True"
                  CornerRadius="10"/>

Getting Started

  1. Install the NuGet package:

    Install-Package Microsoft.Toolkit.Uwp
    
  2. Add the XAML namespace to your page or control:

    xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
    
  3. Use the controls in your XAML:

    <controls:AdaptiveGridView
        ItemHeight="200"
        DesiredWidth="300"
        ItemsSource="{x:Bind Items}"/>
    
  4. For more advanced usage, refer to the official documentation and samples on the GitHub repository.

Competitor Comparisons

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

Pros of microsoft-ui-xaml

  • Official Microsoft product with direct support from the Windows team
  • Focuses on core UI controls and layouts for Windows applications
  • Provides deeper integration with Windows platform features

Cons of microsoft-ui-xaml

  • Limited to Windows platform development
  • Smaller community compared to WindowsCommunityToolkit
  • Less frequent updates and releases

Code Comparison

WindowsCommunityToolkit:

var imageEx = new ImageEx
{
    Source = "https://example.com/image.jpg",
    PlaceholderSource = "ms-appx:///Assets/PlaceholderImage.png",
    IsCacheEnabled = true
};

microsoft-ui-xaml:

var image = new Image
{
    Source = new BitmapImage(new Uri("https://example.com/image.jpg")),
    Stretch = Stretch.UniformToFill
};

The WindowsCommunityToolkit provides enhanced controls like ImageEx with additional features, while microsoft-ui-xaml focuses on core UI elements with platform-specific optimizations.

This app demonstrates the controls available in WinUI and the Fluent Design System.

Pros of WinUI-Gallery

  • Focuses specifically on WinUI 3, providing a comprehensive showcase of its features and controls
  • Offers a more up-to-date representation of modern Windows app development
  • Includes XAML and C# code samples directly in the gallery app

Cons of WinUI-Gallery

  • Limited to WinUI 3 components, lacking the broader scope of Windows Community Toolkit
  • Fewer custom controls and helpers compared to Windows Community Toolkit
  • Less extensive documentation and community contributions

Code Comparison

WinUI-Gallery (XAML):

<Page
    x:Class="AppUIBasics.ControlPages.ButtonPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <StackPanel>
        <Button Content="Standard Button" Click="Standard_Click"/>
    </StackPanel>
</Page>

Windows Community Toolkit (C#):

using Microsoft.Toolkit.Uwp.UI.Controls;

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

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

  • Comprehensive collection of helper functions, custom controls, and app services
  • Regularly updated with new features and improvements
  • Strong community support and active development

Cons of WindowsCommunityToolkit

  • Larger package size due to extensive feature set
  • May include unnecessary components for some projects
  • Steeper learning curve for beginners due to the wide range of features

Code Comparison

WindowsCommunityToolkit:

using Microsoft.Toolkit.Uwp.UI.Controls;

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

Both repositories appear to be the same project, as CommunityToolkit/WindowsCommunityToolkit is likely a redirect or mirror of the main repository. Therefore, a code comparison between the two is not applicable in this case.

The WindowsCommunityToolkit provides a rich set of controls and helpers for Windows app development, making it a valuable resource for developers working on UWP and WinUI projects. While it offers extensive functionality, developers should consider their specific project needs when deciding whether to include the entire toolkit or only specific components.

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
  • Integrated with .NET ecosystem, leveraging existing .NET skills

Cons of MAUI

  • Steeper learning curve for developers new to cross-platform development
  • Limited third-party controls and components compared to WindowsCommunityToolkit
  • Potential performance overhead 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>

WindowsCommunityToolkit:

<Page x:Class="MyApp.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">
    <Grid>
        <controls:AdaptiveGridView ItemsSource="{x:Bind Items}" />
    </Grid>
</Page>

Summary

MAUI offers cross-platform development with a single codebase, while WindowsCommunityToolkit provides a rich set of controls and helpers specifically for Windows development. MAUI has a steeper learning curve but offers broader platform support, whereas WindowsCommunityToolkit excels in Windows-specific scenarios with its extensive collection of pre-built components.

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 multiple platforms, reducing development time
  • Native UI performance through platform-specific renderers

Cons of Xamarin.Forms

  • Steeper learning curve for developers new to mobile development
  • Limited access to platform-specific features without custom renderers
  • Larger app size compared to native applications

Code Comparison

Xamarin.Forms:

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

WindowsCommunityToolkit:

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

The Xamarin.Forms example shows a cross-platform approach to creating a simple UI, while the WindowsCommunityToolkit example demonstrates a Windows-specific XAML-based UI. Xamarin.Forms allows for shared code across platforms, whereas WindowsCommunityToolkit is tailored for Windows development with more platform-specific features and optimizations.

Telerik UI for Universal Windows Platform (UWP) is no longer supported.

Pros of UI-For-UWP

  • Comprehensive set of UI controls specifically designed for UWP applications
  • Extensive documentation and support from Telerik
  • Regular updates and bug fixes from a dedicated team

Cons of UI-For-UWP

  • Commercial product with licensing costs
  • Limited community contributions compared to open-source alternatives
  • Potential vendor lock-in for long-term projects

Code Comparison

WindowsCommunityToolkit:

var control = new InAppNotification();
control.Show("Hello World", 3000);

UI-For-UWP:

RadToastNotification.Show("Hello World", new ToastNotificationSettings
{
    Duration = 3000
});

Both repositories provide UI components for Windows applications, but they differ in their approach and target audience. WindowsCommunityToolkit is an open-source project with a focus on community-driven development and lightweight controls. UI-For-UWP, on the other hand, is a commercial product offering a more extensive set of UI controls with professional support.

While UI-For-UWP may offer more polished and feature-rich controls, WindowsCommunityToolkit benefits from the flexibility and transparency of open-source development. The choice between the two depends on project requirements, budget constraints, and development preferences.

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

✨ New Repository ✨

❗ We moved development to a new repository, 'Windows'. It contains the new infrastructure and codebase for the 8.0+ versions of the Windows Community Toolkit that contains a single-codebase for UWP/WinUI2, WindowsAppSDK/WinUI3, and Uno Platform compatible components. Please visit it for the latest information.

📝 You can find out more about this latest release on our blog post here. The Sample Gallery has also been updated in the Microsoft Store.

🧪 For new feature discussion and development, see Windows Community Toolkit Labs

🐞 For new issues, please try and reproduce on the latest packages, and then open a discussion or issue in the new repository.

📼 This repo contains the prior 7.x UWP-only based code for the Windows Community Toolkit's prior releases; the Windows App SDK compatible code is in the winui branch. Much of this code has been merged and ported to the single-codebase version in the new repository; however, this repo will be archived for history and reference to enable migrating other components or issues, if needed.

🧰 Windows Community Toolkit 7.x

The Windows Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer patterns when building experiences for Windows 10 and Windows 11. It contains components and helpers for both UWP and WinUI 3/WinAppSDK applications. Find out more about our support for WinUI 3 here.

Note: Our general helpers for .NET are now the .NET Community Toolkit, including the MVVM Toolkit.

TargetBranchStatusRecommended package version
Production (UWP)rel/7.1.2Build StatusNuGet
Production (WinAppSDK/WinUI 3)rel/winui/7.1.2Build StatusNuGet
PreviewsmainBuild StatusDevOps

📢 Windows Community Toolkit v8

The toolkit has been migrated to new infrastructure in this repository.

Read the original blog post that explained this here, but see latest information at the top of this file.

🧪 Windows Community Toolkit Labs 💻

Labs makes it easy to contribute to the Windows Community Toolkit, try out new features still in development, and collaborate with others.

Find out more here.

🙌 Getting Started

Please read the Getting Started with the Windows Community Toolkit page for more detailed information about using the toolkit.

📃 Documentation

All documentation for the toolkit is hosted on Microsoft Docs. All API documentation can be found at the .NET API Browser.

📱 Windows Community Toolkit Sample App

Want to see the toolkit in action before jumping into the code? Download and play with the Windows Community Toolkit Sample App from the Store.

⁉ Support

If you need help with something or have an idea, feel free to start a Discussion or find us on Discord. If you have detailed repro steps, open an issue here instead.

🚀 Contribution

Do you want to contribute? Check out our Windows Community Toolkit Wiki page to learn more about contribution and guidelines.

📦 NuGet Packages

NuGet is a standard package manager for .NET applications which is built into Visual Studio. When you open solution in Visual Studio, choose the Tools menu > NuGet Package Manager > Manage NuGet packages for solution… Enter one of the package names mentioned in Windows Community Toolkit NuGet Packages table to search for it online.

📫 Features

The Features list refers to all the currently available features that can be found in the Windows Community Toolkit. Most features should work with the October 2018 Update (1809) SDK 17763 and above; however, refer to specific documentation on each feature for more information.

💠 Principles

  1. The toolkit will be kept simple.
  2. As soon as a comparable feature is available in the Windows SDK for Windows, it will be marked as deprecated.
  3. All features will be supported for two Windows SDK for Windows release cycles or until another principle supersedes it.

🌍 Roadmap

See our 2022 Plans here.

Read what we plan for next iterations, and feel free to ask questions.

Check out our Preview Packages Wiki Page to learn more about updating your NuGet sources in Visual Studio, then you can also get pre-release packages of upcoming versions to try.

📄 Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.

🏢 .NET Foundation

This project is supported by the .NET Foundation.

🏆 Contributors

Toolkit Contributors

Made with contrib.rocks.