In my XAML, I have an object which binds to a sub-object of the main object from the view model:
Text="{Binding Employee.AccountBalances.CompBalance, StringFormat='\{0\} days'}"
During start-up, the Employee object is populated, and property change raised in the view model:
public EmployeeInfo Employee
{
get { return this._employee; }
set
{
this._employee = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("Employee"));
}
}
}
That all works great, and the text box displays the appropriate balance. However, if I set the 'AccountBalances'
property of the Employee (for example, this.Employee.AccountBalances = result.AccountBalances), the textbox value
does not change.
Shouldn't it change when that particular property of the Employee changes, since it's in the hierarchy and bound to the UI?
If not, how do I get it to update when the AccountBalances property changes? Thanks very much.