I have been trying to detect it when these variables change, but I don't know how to do that since bools aren't supported by the "PropertyChanged" function. I also tried using the communityToolKit, but I have no idea how to use that. I want it to call the function "IconUpdater"
public class Status : INotifyPropertyChanged
{
public static bool isWorking { get; set; } = Preferences.Get("IsWorking", true);
public static bool isPaused { get; set; } = Preferences.Get("IsPaused", false);
public static void IconUpdater()
{
// The function I want to call \\
}
public event PropertyChangedEventHandler PropertyChanged;
}
You can use
PropertyChangedevent to notify the changes ofIsEnabledproperty in your viewmodel. Here's the code snippet below for your reference: