1

Are there any limitation on using Prism and Fody.PropertyChanged?

I'm trying to use Fody to implement the OnPropertyChange for the variables at my ViewModel, but it isn't working. The property change isn't firing.

I tried to remove the BindableBase inherited from my class and continues the same.

The FodyWeavers is configured with PropertyChanged

Any ideas?

Edit:

I want to use Fody's PropertyChanged to avoid this code on every property on my ViewModel:

private People pessoa;
public People Pessoa
{
    get { return pessoa; }
    set
    {
        if (pessoa == value) return;

        pessoa = value;
        OnPropertyChanged();
    }
}

private bool isBusy;
public bool IsBusy
{
    get { return isBusy; }
    set
    {
        if (isBusy == value) return;

        isBusy = value;
        OnPropertyChanged();
    }
}

Using like this:

[ImplementPropertyChanged]
public class AlterarPerfilPageViewModel : BindableBase, INavigationAware
{
  public People Pessoa;
  public bool IsBusy;
}

1 Answers1

4

I think the problem is that you have implemented fields in tour class not properties. Try:

[ImplementPropertyChanged]
public class AlterarPerfilPageViewModel : BindableBase, INavigationAware
{
  public People Pessoa {get; set;}
  public bool IsBusy {get; set;};
}