.NET Community Toolkit Adds Partial Properties Support For MVVM
Thursday, 19 December 2024

Microsoft has announced version 8.4 of the .NET Community Toolkit, a collection of helpers and APIs that work for all .NET developers. The new version adds support for partial properties for the MVVM Toolkit generators along with new analyzers.

The Community Toolkit is UI platform agnostic. While it is maintained and published by Microsoft, and is part of the .NET Foundation, it can be used by application developers regardless of the specific UI framework in use.

net2

The toolkit is made up of libraries that were originally part of the Windows Community Toolkit that Microsoft released to simplify building UWP and .NET apps for Windows 10 and Windows 11.

The toolkit developers say that support for partial properties for the MVVM Toolkit source generators is one of the most popular feature requests. It has been possible because of the new C# language features available in the .NET 9 SDK, and the source generators will now make use of partial properties and semi-auto properties (the field keyword) to make it possible to define observable properties.More modifers are also now supported including new, sealed, override, and required.

This release also adds to the MVVM Toolkits diagnostic analyzers, with a number of new analyzers for general code analysis and CsWinRT trim/AOT supporting code analysis (for UWP and WinUI 3). In the general code analysis category, there are several related to partial properties, including telling developers when fields can be converted to partial properties, when fields with partial properties requires a higher version of Roslyn, and when properties annotated with [ObservableProperty] must be instance partial properties with a getter and a setter that is not init-only.

Other improvements include the inclusion of MSBuild logic to provide friendly error messages when using an incorrect version of the Windows SDK package; and a new AsStream() extension for ReadOnlySequence to easily get a readonly, seekable stream wrapping it.

.NET Community Toolkit is available now on GitHub. 

net2

More Information

.NET Community Toolkit On GitHub

Related Articles

.NET Community Toolkit 8.2 Adds Faster Generators

.NET MAUI Community Toolkit Adds TouchBehavior

.NET Community Toolkit Updated

MAUI Framework And Community Toolkit Released

Microsoft Launches .NET Community Toolkit  

MAUI Compatibility For Xamarin Community Toolkit

.NET Celebrates 20th Anniversary of Launch

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Windows 11 Adoption Takes A Downturn
11/12/2024

With Windows 10 End of Life only ten months away, Microsoft is stepping up its campaign to get Windows users to upgrade to Windows 11. But while Windows 11 had been gaining users at a steady rate at t [ ... ]



Visual Studio 17.12 Released Along With Aspire
25/11/2024

Visual Studio 2022 v17.12 is now available. The release can be used for .NET 9 projects and has a range of other improvements.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info