.NET Community Toolkit 8.1 enhances MVVM capabilities

MVVM toolkit updates include new diagnostic analyzers and performance optimizations for improved developer user experience.

tools / toolkit / toolbelt
Jesse Orrico (CC0)

Microsoft has improved functionality, performance, and diagnostics in the MVVM toolkit portion of the .NET Community Toolkit. The upgrade was released this week.

Unveiled January 18, .NET Community Toolkit 8.1 adds dedicated analyzers to the MVVM (model-view-viewmodel) toolkit. Previously, the MVVM toolkit emitted diagnostics for features used incorrectly. Now, it can offer recommendations for improving code. Another analyzer has also been added to help reduce binary size in applications.

Performance optimizations are intended to improve the developer user experience, particularly when working on large solutions. The architecture of generators was improved with capabilities such as multi-targeting for the Roslyn 4.3 compiler platform. Diagnostics were moved to diagnostics analyzers to reduce overhead when typing. Incremental providers were also updated to no longer propagate symbols, thus reducing memory use. To improve performance and reduce memory allocations, incremental models and pipelines were overhauled. The updated MVVM toolkit also features new IObservable<T> extensions for the IMessenger interface bridges functionality exposed by messenger APIs.

.NET Community Toolkit 8.1 also adds the .NET 7 target framework monitor to the high-performance package and includes changes to benefit C# 11 ref fields. Version 8.1 also takes some types out of preview, including Ref<T>, ReadOnlyRef<T>, NullableRef<T>, and ReadOnlyNullableRef<T>. New ref safety rules are in place for these types.

In addition to the updated MVVM toolkit, .NET Community Toolkit includes the following libraries:

  • CommunityToolkit.Common
  • CommunityToolkit.Diagnostics
  • CommunityToolkit.HighPerformance

Source code for NET Community Toolkit, which offers APIs and helpers for .NET developers regardless of the UI framework, can be found on GitHub.

Copyright © 2023 IDG Communications, Inc.