Hello,
Do you add INotifyPropertyChanged
inteferface for your model? For example, I create a model that called Device.cs
, I need to implement INotifyPropertyChanged
interface, then achieve get/set
method like following code.
public class Device: INotifyPropertyChanged
{
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public event PropertyChangedEventHandler PropertyChanged;
private string _status;
public string Status
{
set
{
if (_status != value)
{
_status = value;
OnPropertyChanged("Status");
}
}
get
{
return _status;
}
}
public string Image { get; set; }
public string Name { get; set; }
}
If you change the value of Status changed, deviceToStatusColor
converter will be executed.
If you have implemented INotifyPropertyChanged
interface, could you minimize code to just what is needed to reproduce the problem? Such as ViewModel class and Model class.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.