I am getting an error: "Cannot apply attribute class 'ICommand' because it is abstract"

huangapple go评论127阅读模式
英文:

I am getting an error: "Cannot apply attribute class 'ICommand' because it is abstract"

问题

I installed 8.0.0 version of MVVM package. I tried it with another version too. I tried to resolve the issue by changing the package to current version but the same error is triggered again can you please help me to sort it?

英文:

This is the code which I have used and I installed 8.0.0 version of MVVM package. I tried it with another version too

I tried to resolve the issue by changing the package to current version but the same error is triggered again can you please help me to sort it

答案1

得分: 1

请将[ICommand]更改为[RelayCommand],例如:

[RelayCommand]
void Add()
{

}

在Community Toolkits MVVM包中,没有[ICommand]属性,而是一个[RelayCommand]属性。

英文:

Please change the [ICommand] to the [RelayCommand]. Such as:

 [RelayCommand]
 void Add()
 {
 
 }

There is no [ICommand] attribute in the Community Toolkits MVVM package but a [RelayCommand] attribute.

huangapple
  • 本文由 发表于 2023年7月18日 14:35:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76710076.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定