View notification does not work with mvvmhelper

Asked

Viewed 23 times

0

I’m using James Montemagno’s mvvmhelper to develop my app and using the same structure that he teaches to use. I mean with a Baseviewmodel and when I navigate between the pages everything works perfectly, I load the properties in the constructor of my viewmodel and they are displayed in the form. but when I make any changes to the same properties that should update my view, it doesn’t update, as if the property change isn’t notifying the view.

Someone has already gone through this using the mvvmhelper?

1 answer

0


If I understand your question, you are referring to a Viewmodel that is not updating in your View view view, correct? To accomplish this your Viewmodel must implement Inotifypropertychanged and in the case of Mvvmhelper you must use Setproperty as follows, below is an example of code:

public class PersonViewModel : BaseViewModel
{
    private string _name;
    public string Name{
       get{
           return _name;
       }
       set{
           SetProperty(ref _name, value);
       }
    }
}
  • Thanks Junior, you were right! I thought that by using mvvmhelper I could declare my properties normally by putting this set { _visivelValidaEmail = value; } but actually it has to be like this Setproperty(ref _visivelValidaEmail, value);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.