I have 2 viewmodels say,
viewmodel is bound to view
class A : INotifyPropertyChanged
{
public A(){}
private bool _propertya;
public bool PropertyA
{
get{return _propertya;}
set{_propertya=value; onPropertyChanged("PropertyA");}
}
private void onPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
And another viewmodel where my properties are linked to another view
class B : INotifyPropertyChanged
{
public B(){}
private bool _propertyb;
public bool PropertyB
{
get{ return _propertyb;}
set{_propertyb=value; onPropertyChanged("PropertyB");}
}
private void onPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
When PropertyB is changed , I want to check the value of PropertyA from another viewmodel and return bool value based on condition. How can i get the instance of PropertyA from another viewmodel in class B