Microsoft announced version 8.1 of the .NET Community Toolkit, which includes highly requested features, bug fixes, and performance improvements to the MVVM Toolkit source generators.
The new version includes custom attributes for ‘[ObservableProperty].’ With no constraints on the types of attributes that this feature supports, this allows complete flexibility in annotations for generated properties, all while using built-in C# syntax.
The release is also the first one to introduce dedicated analyzers so that the MVVM Toolkit will no longer just emit diagnostics for features used incorrectly, but will also show recommendations to improve the code and avoid common errors.
The first analyzer will alert users when they assign values to fields that support an observable property, prompting them to use the generated property instead. The second analyzer can shrink the size of binaries in applications that utilize the MVVM Toolkit.
The new version has also added multi-targeting for Roslyn 4.3 so that the MVVM Toolkit source generators will now use the Roslyn 4.3 target if supported.
Thanks to the new IObservable<T> extensions for the IMessenger interface, developers who heavily utilize Reactive-style APIs in their applications can now bridge the functionality exposed by the messenger APIs in the MVVM Toolkit, a feature they had heavily requested.
The new release of the Toolkmity adds .NET 7TFM to the HighPerformance package and it includes several changes to benefit from the new C# 11 language features.