.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
I am using CommunityToolkit.Mvvm 8.2.2. I have the following ViewModel which I want to serialize to Json, but, unfortunately, the unwanted [RelayCommand] is appearing as well:
I'm using the ViewModel in a Maui application with the following XAML:
<VerticalStackLayout>
<Label Text="{Binding Acc, StringFormat='Acc: {0}'}" />
<Label Text="{Binding AccPower, StringFormat='AccPower: {0}'}" />
<Label Text="{Binding Json, StringFormat='Json: {0}'}" />
<Button Text="Click me" Command="{Binding IncAccCommand}"/>
</VerticalStackLayout>
Expected behavior
I would like the Label that shows the Json property to show:
Describe the bug
I am using CommunityToolkit.Mvvm 8.2.2. I have the following ViewModel which I want to serialize to Json, but, unfortunately, the unwanted [RelayCommand] is appearing as well:
The value being returned by
Json
property is:The desired
Json
property is:Regression
No response
Steps to reproduce
Expected behavior
I would like the
Label
that shows theJson
property to show:Screenshots
No response
IDE and version
VS 2022
IDE version
Visual Studio 17.7.4
Nuget packages
Nuget package version(s)
CommunityToolkit.Mvvm 8.2.2
Additional context
No response
Help us help you
Yes, but only if others can assist