WinUIEssentials
C++ programmer is not part of windows community therefore cannot use the windows community toolkit. So I made one for C++. QQ讨论群:479734355
Install / Use
/learn @HO-COOH/WinUIEssentialsREADME

WinUI Essentials
A repo dedicated for simplifying C++ development with WinUI2 (Universal Windows Platform) and WinUI3 (Windows App SDK).
Nuget
Example Gallery
Download from Microsoft Store!
<a href="https://apps.microsoft.com/detail/9pcc690bcmt9?referrer=appbadge&mode=direct"> <img src="https://get.microsoft.com/images/en-us%20dark.svg" width="200"/> </a>Example project build status:
|Platform|Debug|Release|
|---|---|---|
|x86| |
|x64|
|
|~~ARM~~| ~~
~~ | ~~
~~
|ARM64|
|
Usage
[!NOTE] Update since WinEssential.WinUI3 1.5, you do NOT need to add control resources in
Application.Resources!
[!WARNING] Make sure to set your C++ language version to C++20 first!
Open the WinUIEssential.sln containing 4 projects:
- UWPPackage (project for WinUIEssential.UWP nuget package)
- UWPExample (example gallery for using the above package)
- WinUI3Package (project for WinUIEssential.WinUI3 nuget package)
- WinUI3Example (example gallery for using the above package)
Build the *Package project will build the project and pack it with nuget, then install the nuget to your project and start using it.
To build the *Example project, do the same thing. They did not reference *Package for demo purposes.
[!NOTE] Functionalities for UWP and WinUI3 should be exactly the same unless otherwise noted!
It should be useful until the community toolkit provides C++.
Build and contribute
Build requirements
- You need to have vcpkg installed and integrate setup for msbuild. See this documentation for guide.
- You need to have Visual Studio 2026 with
Desktop development with C++andWinUI Application developmentworkload installed. (2022 will NOT work, as we are using thev145C++ tools) - You need to build both
DebugandReleasebuild to successfully build and debug the example project (this is intentional for not missing debug version of the package) -
= Windows 10 17763 (Actually I mostly use Windows 10 17763 to ensure compatibility that WinUI3 claims to support)
You can reference Github Action for detailed build steps.
Contribute a new templated control
- DO NOT submit a PR that's purely AI written WITHOUT your reviewing. I will NOT review it.
- Create a control under the
Controlsfolder, with theViewModelfile template, then you edit theidlas needed - If the control has a
ResourceDictionaryxaml, add an entry in theWinUIEssential.WinU3.targetsso that the.xbffile is properly copied (see that file for example) - Please also consider adding a demo page for the control, and add it to
MainWindow.xaml.hMainWindow::s_page(see the file for example)
Content
|Component|UWP|WinUI3|Type |--|--|--|--| |WinUIIncludes| :white_check_mark: | :x: | Header only |TemplateControlHelper| :white_check_mark: | :white_check_mark: | Header only |Glyphs| :white_check_mark: | :white_check_mark: | Header only + Xaml only |BadgeGlyphs| :white_check_mark: | :white_check_mark: | Header only |ToastTemplates| :white_check_mark: | :white_check_mark: | Header only |ToastBuilder | :white_check_mark: | :white_check_mark: | Header only |TileTemplates| :white_check_mark: | :white_check_mark: | Header only |TileBuilder | :white_check_mark: | :white_check_mark: | Header only |CursorController | :white_check_mark: | :white_check_mark: | WinRT component |PropertyChangeHelper | :white_check_mark: | :white_check_mark: | Header only |NegateBoolConverter | :white_check_mark: | :white_check_mark: | WinRT component |BoolToVisibilityConverter | :white_check_mark: | :white_check_mark: | WinRT component |ContainerToBoolConverter | :white_check_mark: | :white_check_mark: | WinRT component |StringToBoolConverter | :white_check_mark: | :white_check_mark: | WinRT component |ReferenceToBoolConverter | :white_check_mark: | :white_check_mark: | WinRT component |ConverterGroup | :white_check_mark: | :white_check_mark: | WinRT component |Convert | :x: | :white_check_mark: | WinRT component |IsEqualStringTrigger| :white_check_mark: | :white_check_mark: | WinRT component |IsNullOrEmptyStateTrigger | :white_check_mark: | :white_check_mark: | WinRT component |ControlSizeTrigger | :white_check_mark: | :white_check_mark: | WinRT component |CharmBar | :white_check_mark: | :x: | WinRT component |GroupBox | :white_check_mark: | :white_check_mark: | Control |SettingsCard | :white_check_mark: | :white_check_mark:* | Control |SettingsExpander | :white_check_mark: | :white_check_mark:* | Control |FontIconExtension | :white_check_mark: | :white_check_mark: | WinRT component |DependentValue| :white_check_mark: | :white_check_mark: | WinRT component |Taskbar| :x: | :white_check_mark: | Header only |MarqueeText | :white_check_mark: | :white_check_mark: | Control |ProgressBarEx | :white_check_mark: | :white_check_mark: | Control |WindowEx | :x: | :white_check_mark: | Window |TransparentBackdrop | :x: | :white_check_mark: | SystemBackdrop |Segmented | :white_check_mark: | :white_check_mark: | Control |CustomMicaBackdrop | :x: | :white_check_mark: | Backdrop |CustomAcrylicBackdrop | :x: | :white_check_mark: | Backdrop |Shimmer | :white_check_mark: | :white_check_mark: | Control |ImageExtension | :white_check_mark: | :white_check_mark: | WinRT component |SwitchPresenter | :x: | * :white_check_mark: | Control |ModernStandardWindowContextMenu| :x: | * :white_check_mark: | WinRT component |WindowContextMenu | :x: | :white_check_mark: | WinRT component |NonResizableWindowWhiteBorderWorkaround | :x: | :white_check_mark: | WinRT component |ComboBoxHelper | :x: | :white_check_mark: | WinRT component |AutoSuggestBoxHelper | :x: | :white_check_mark: | WinRT component |WrapPanel | :x: | :white_check_mark: | Panel |ToolTipHelper | :x: | :white_check_mark: | WinRT component |CommandBarHelper | :x: | :white_check_mark: | WinRT component |IInitializeWithWindowHelper | :x: | :white_check_mark: | Header only |WindowCaptionButtonThemeWorkaround | :x: | :white_check_mark: | WinRT component |MicaBackdropWithFallback | :x: | :white_check_mark: | WinRT component |NonMaximizableWindowWorkaround | :x: | :white_check_mark: | WinRT component |DatePickerHelper | :x: | :white_check_mark: | WinRT component |TimePickerHelper | :x: | :white_check_mark: | WinRT component |FlyoutHelper | :x: | :white_check_mark: | WinRT component |CalendarDatePickerHelper | :x: | :white_check_mark: | WinRT component |ModalWindow | :x: | :white_check_mark: | WinRT component |NavigationViewHelper | :x: | :white_check_mark: | WinRT component |SliderHelper | :x: | :white_check_mark: | WinRT component |RevealFocusPanel | :x: | :white_check_mark: | Control |TenMica | :x: | :white_check_mark: | WinRT component
*means additional settings required, see the sections for info
WinUIIncludes
Include the WinUI2 headers in your pch.h, so you don't waste your time figuring out where the compilation error comming from./
Usage:
Add this in your pch.h
#include <WinUIIncludes.hpp>
TemplateControlHelper
Automatically call DefaultStyleKey() for your templated control so you don't waste your time when you forget to include this line and get an empty control.
Usage: Inherit this class in your header file, make the template argument your implementation type.
#include <TemplateControlHelper.hpp>
...
struct MyControl : MyControlT<MyControl>, TemplateControlHelper<MyControl>
{
...
};
ToastHelper
Helper for creating toast notifications.
ToastTemplates --- namespace ToastTemplates
The built-in templates re-written to strongly-typed classes that derived from winrt::Windows::UI::Notification::ToastNotification, so that you can
