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

Subscribe on YouTube