.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.
If you have an interface, without a generic type, that requires the implementation of an ICommand property it isn't possible to use the RelayCommandAttribute on a generic class that uses the generic type as parameter on the command method.
The RelayCommandAttribute generates a property of type IRelayCommand<T> that doesn't satisfy the implementation of the interface.
Regression
No response
Steps to reproduce
public interface ITest
{
ICommand TestSomethingCommand { get; }
}
public partial class Test<T> : ITest
{
// Generates a property of type IRelayCommand<T>, this doesn't satisfy ITest.ICommand
[RelayCommand]
private void TestSomething(T obj)
{
}
}
Expected behavior
The generated property should be of type ICommand or RelayCommandAttribute should have an option to generate the property with of type ICommand instead of IRelayCommand<T>.
Describe the bug
If you have an interface, without a generic type, that requires the implementation of an
ICommand
property it isn't possible to use theRelayCommandAttribute
on a generic class that uses the generic type as parameter on the command method. TheRelayCommandAttribute
generates a property of typeIRelayCommand<T>
that doesn't satisfy the implementation of the interface.Regression
No response
Steps to reproduce
Expected behavior
The generated property should be of type
ICommand
orRelayCommandAttribute
should have an option to generate the property with of typeICommand
instead ofIRelayCommand<T>
.Screenshots
No response
IDE and version
VS 2022, Rider
IDE version
No response
Nuget packages
Nuget package version(s)
8.2.2
Additional context
No response
Help us help you
Yes, but only if others can assist