CommunityToolkit / dotnet

.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.
https://docs.microsoft.com/dotnet/communitytoolkit/?WT.mc_id=dotnet-0000-bramin
Other
2.99k stars 294 forks source link

RelayCommand attribute only works in .Net 6 and above? #847

Open tp1415926535 opened 7 months ago

tp1415926535 commented 7 months ago

Describe the bug

WPF, Using the [RelayCommand] in versions lower than .Net6 (.Net 5, .Net core3.1 etc.) will not prompt for the need to set partial for the class, and cause binding error at runtime: System.Windows.Data Error: 40 : BindingExpression path error: 'ButtonClickCommand' property not found on 'object' ''ViewModel' (HashCode=47044325)'. BindingExpression:Path=ButtonClickCommand; DataItem='ViewModel' (HashCode=47044325); target element is 'Button' (Name=''); target property is 'Command' (type 'ICommand')

Regression

No response

Steps to reproduce

Expected behavior

Support lower Net Version

Screenshots

No response

IDE and version

VS 2019

IDE version

No response

Nuget packages

Nuget package version(s)

8.2.2

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item