News

.NET Community Toolkit v8.0 Preview Revamps MVVM Library

Microsoft announced the first preview of .NET Community Toolkit v8.0.0, which revamps the MVVM library and introduces a new GitHub repo to host the project.

This .NET Foundation project is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. It's one of a number of similar toolkits, which typically are collections of helper functions, custom controls and app services designed to simplify and demonstrate common developer tasks for projects of varying types. For example, under the guise of the Community Toolkit GitHub repo are kits for Windows, .NET MAUI and more.

The included .NET Community Toolkit resulted from a Microsoft effort to split out its .NET-specific libraries from the existing Windows Community Toolkit into their own dedicated repository. The .NET Community Toolkit contains libraries for MVVM, Diagnostics, High Performance and more.

The project's GitHub release page lists all breaking changes, bug fixes, improvements and new features in Preview 1. The new features and improvements include:

New Features and Improvements
[Click on image for larger view.] New Features and Improvements (source: GitHub).

One key component of the .NET kit provides MVVM source generators to augment the MVVM library, and Preview 1 includes a revamped and improved preview of those source generators. They now run faster, feature simplified commands, add new observable properties attributes and include a Viewmodel composition tweak to get around C#'s lack of multiple inheritance support.

"All generators have been rewritten from scratch to be incremental generators, meaning they will run much faster than before and they will help keep the IDE fast and responsive even when working on large scale projects," said Sergio Pedri of the Microsoft Store client team in a Jan. 25 blog post. "These APIs are meant to greatly reduce the necessarily boilerplate when working with MVVM, with helpers ranging from observable properties to commands."

Also, .NET 6 is now supported as a new target across all libraries, which adds these benefits:

  • Trimming support is now enabled for all libraries.
  • The Count<T>() extension in the HighPerformance package now also supports nint and nuint.
  • Several optimizations have been introduced when on .NET 6.

The new GitHub repo for the project, meanwhile, is where all .NET libraries can be found from now on.

"Libraries in this new toolkit have no dependencies on any specific UI frameworks, so they can be used by all developers regardless of the framework or runtime they choose to work on their projects," Pedri said. "That is, the .NET Community Toolkit can be referenced by applications and libraries targeting .NET, .NET Core, .NET Standard, .NET Framework, WPF, UWP, MAUI, Xamarin, Unity, and more!"

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