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 at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube