News

Windows Community Toolkit 7.1: MVVM Source Generators, Identity Authentication, ML APIs

A bevy of new features and enhancements debut in a preview of the upcoming Windows Community Toolkit 7.1 release, a collection of helpers, extensions and custom controls that simplify and demonstrate common developer tasks building UWP and .NET apps for Windows 10.

The kit helps developers build apps for any Windows 10 device, including PC, Mobile, Xbox, IoT and HoloLens, with various functionalities demonstrated in a sample app:

Windows Community Toolkit Sample App
[Click on image for larger view.] Windows Community Toolkit Sample App

Part of the .NET Foundation, the kit is now developed on GitHub as part of a broader Community Toolkit organization that has grown to encompass these offerings:

  • Windows Community Toolkit
  • Graph Community Toolkit
  • MVVM Toolkit
  • MAUI Community Toolkit

Also, a new .NET Community Toolkit is planned.

In the new WCT v7.1 preview, the MVVM library component now supports source generators, a C# compiler feature that lets C# developers inspect user code as it is being compiled and generates new C# source files on the fly that are added to the user's compilation.

This graphic shows original hand-written example code written using the toolkit as customary, while the right-hand side shows how new source generator attributes can be used to automatically generate the same exact code:

MVVM Source Generators in Action
[Click on image for larger view.] MVVM Source Generators in Action (source: Microsoft).

Microsoft said source generators make the library more flexible, easier to use and more efficient, alleviating the need to write extra boiler-plate code.

The Graph offering, meanwhile, gets new helpers and providers for authenticating with Microsoft Identity with the introduction of a variety of new authentication packages. Functionality for calling Microsoft Graph APIs has also been improved, and Graph controls and helpers have been re-introduced in new packages.

Also new are new Intelligent APIs designed to make machine learning easier for developers who need to leverage the technology without extensive expertise.

"By just importing a NuGet package and calling a function, we want developers to be able to build intelligent app experiences without needing to deal with the complexities of creating and using machine learning models on Windows," Microsoft said.

We are currently experimenting with this concept by wrapping two existing state-of-the-art models into NuGet packages. They enable the developer to add image classification and object detection capabilities quickly and easily into their projects with a single function call."

Community Toolkit Labs has also been introduced, following the pattern of other organizations that foster innovation by providing a space for developers to work on projects -- incubating and working on new features -- in a safe space outside of the normal workflow. It lets them work and collaborate on innovative coding without having to worry about documentation, samples, testing and so on.

The team will create a central repository for smaller features and controls to be proposed, incubated and worked on with the community, with a dedicated NuGet feed for Toolkit Labs in the organization's public DevOps package feed.

More information on all of the above can be found in preview release notes and the project wiki.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

Subscribe on YouTube