18

I'm using the package CommunityToolkit.Mvvm 8.0.0 in .Net MAUI.

I have a simple class as follows :

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;
    }
}

This class raises a compilation error on the attribute AlsoNotifyChangeFor.

It says "The type or namespace name could not be found" for this attribute to be used.

Where can I find the right package to use this attribute?

1
  • 1
    "Tell 'em James Montemagno sent ya! They'll know what to do." haha. Commented Nov 1, 2023 at 18:52

1 Answer 1

62

in the release notes, under breaking changes

[AlsoNotifyChangeFor] ---> [NotifyPropertyChangedFor]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.