在哪个包中,我可以在 .Net MAUI 中找到“AlsoNotifyChangeFor”?

Tho*_*ton 15 maui

我在 .Net MAUI 中使用 CommunityToolkit.Mvvm 8.0.0 包。

我有一个简单的课程如下:

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Collections;
using CommunityToolkit.Mvvm.DependencyInjection;
using CommunityToolkit.Mvvm.Messaging;

namespace My.ViewModels
{

    public partial class BaseViewModel:ObservableObject
    {
        public BaseViewModel()
        {
        }

        [ObservableProperty]
        [AlsoNotifyChangeFor(nameof(IsNotBusy))]   <<<< Compilation error here
        bool isBusy;

        [ObservableProperty]
        string title;

        public bool IsNotBusy => !isBusy;
    }
}
Run Code Online (Sandbox Code Playgroud)

此类在属性AlsoNotifyChangeFor上引发编译错误。

对于要使用的属性,它显示“找不到类型或命名空间名称”。

在哪里可以找到使用此属性的正确包?

Jas*_*son 50

发行说明中,根据重大更改

[AlsoNotifyChangeFor] ---> [NotifyPropertyChangedFor]
Run Code Online (Sandbox Code Playgroud)