Windows
Windows
Announcing Windows Community Toolkit v7.1
The Windows Community Toolkit has another update filled with improvements and features! We’re thrilled to announce version 7.1 is available today! Made possible again with the support and contributions of our developer community. If you are new to the Toolkit, the Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks for building UWP and .NET apps for Windows. The toolkit is part of the .NET Foundation. You can playground to discover and try Toolkit components before getting started on a project.Microsoft Identity Authentication Helpers, OneDrive Storage, and Microsoft Graph Controls -
New and improved for 7.1, our Microsoft Graph offering is moving out of its prior preview phase and has been overhauled and streamlined with new helpers and providers for authenticating with Microsoft Identity and calling Graph APIs. We received a lot of great feedback from the community that we hope will help devs hit the ground running, authenticating users, and calling APIs!Authentication Providers
In this release we are introducing a variety of new authentication packages:Package | Description |
CommunityToolkit.Authentication | Core constructs for supporting authentication aware applications. |
CommunityToolkit.Authentication.Msal | Authentication provider based on the official Microsoft Authentication Library (MSAL) for .NET SDK. |
CommunityToolkit.Authentication.Uwp | Authentication provider based on the native account management APIs in Windows. |
Graph Powered Controls and OneDrive Helpers
Next, we are re-introducing our Graph controls and helpers in the form of two new packages:Package | Description |
CommunityToolkit.Graph | Extensions and helpers for making adhoc Graph requests, leveraging the official Graph SDK for .NET. |
CommunityToolkit.Graph.Uwp | Windows specific helpers and controls for facilitating authentication flow and visualizing Graph data. |
- Extensions – Call GetClient() or GetBetaClient() on any IProvider instance to get access to a pre-configured GraphServiceClient on demand.
- OneDriveStorageHelper and UserExtensionStorageHelper – New helpers for storing settings and file data in Graph based storage locations, such as OneDrive or open extensions on the Graph User object.
- Controls – LoginButton, PeoplePicker, and PersonView (GraphPresenter is still experimental.)
- ProviderStateTrigger – A StateTrigger for detecting when the global authentication provider has been signed in.
- ElementExtensions.IsVisibleWhen – Extension on FrameworkElement for declaring element visibility behavior in response to authentication changes.
Attached Shadows - and
Move over DropShadowPanel and hello Attached Shadows! Attached shadows make it even easier to add this great depth effect to your app, now without having to modify your layout! !AttachedCardShadow using Win2D
The AttachedCardShadow is a rectangular-based shadow (which supports rounded corners) that can be applied directly to an element without the need for any other configuration. It should be your new go-to shadow option if you don’t mind the Win2D dependency it requires.AttachedDropShadow using Composition
The AttachedDropShadow supports masked shadows for transparent images, shapes, and text. It uses the composition layer, so it’ll work with any UWP app. It has inherited the implementation of DropShadowPanel, but it works a bit differently. Be sure to check out our and to learn more.RichSuggestBox -
WinUI 2.7 and other Improvements!
We’ve updated to base on control packages on the new WinUI 2.6 and 2.7 update which also includes updated styles. We’ll continue to update our control styles with the new design guidance over time.- by and
- Updated by and by to use WinUI controls as base.
- New by
- New Control by and </> (also used in the Microsoft Store App!)
- by
- by
- by
- by
- Visual State Trigger by
- by
On The Horizon
MVVM Source Generator [Preview] -
The MVVM Toolkit now has support for (in preview). This makes the library more flexible, easier to use, and even more efficient! Following is a small sample of some source generator attributes in action. On the left-hand side is the original hand-written example using the MVVM Toolkit, as you would today. On the right-hand side is how you can use the new attributes to automatically generate the exact same code!- The [ObservableProperty] attribute creates a super compact way of creating an observable property from just a field and annotation. [AlsoNotifyChangeFor] can also be used to raise a change notification for another dependent property.
- The [ICommand] attribute will let you annotate methods in a ViewModel and generate all the corresponding command properties. This includes support for generic commands and asynchronous commands: just annotate an async method returning a Task!
- You can also annotate a class with [INotifyPropertyChanged], [ObservableObject], [ObservableRecipient], or [ObservableValidator] to inject all the boilerplate code needed to use those MVVM helpers while still inheriting from other base classes! You can also use this to mix together inheriting from ObservableRecipient and then add the [ObservableValidator] attribute to combine all APIs from both classes.