使用Xamarin.Forms与Prism和Fody

使用Xamarin.Forms与Prism和Fody,xamarin.forms,prism,fody-propertychanged,Xamarin.forms,Prism,Fody Propertychanged,使用Prism和Fody.PropertyChanged是否有任何限制 我试图使用Fody在我的ViewModel中实现变量的OnPropertyChange,但它不起作用。属性更改未触发 我试图删除从我的类继承的BindableBase,并继续相同的操作 FodyWeavers配置了PropertyChanged 有什么想法吗 编辑: 我想使用Fody的PropertyChanged来避免在我的ViewModel上的每个属性上出现以下代码: private People pessoa; pub

使用Prism和Fody.PropertyChanged是否有任何限制

我试图使用Fody在我的ViewModel中实现变量的OnPropertyChange,但它不起作用。属性更改未触发

我试图删除从我的类继承的BindableBase,并继续相同的操作

FodyWeavers配置了PropertyChanged

有什么想法吗

编辑:

我想使用Fody的PropertyChanged来避免在我的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();
    }
}
这样使用:

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

我认为问题在于您在tour类中实现了字段,而不是属性。 尝试:


我认为问题在于您在tour类中实现了字段,而不是属性。 尝试:


你到底想实现什么?你能为你的视图模型类发布你的代码吗?我同时使用prism和fody,它们工作得很好。你到底想实现什么?你能为你的视图模型类发布你的代码吗?我同时使用prism和fody,它们工作得很好。这里不需要BindableBase,如果使用fody,这里不需要BindableBase,如果使用fody
[ImplementPropertyChanged]
public class AlterarPerfilPageViewModel : BindableBase, INavigationAware
{
  public People Pessoa {get; set;}
  public bool IsBusy {get; set;};
}