I have a binding without path using a converter. This is because the converter will use many properties of the object to build the text for the tooltip. But when one property ch
Just to make it clear:
You have some DataTemplate
for item in a collection. Type of item is Bar
. ItemsSource
for parent list is a collection of Bar
objects. You want to change tooltip if any property in particular Bar
object changes.
Problem is that when you are not specifying specific path binding will subscribe to change notification of DataContext
which in your case is Bar
. So it does not care about changes or notifications within your object.
You can implement bubbling so changed event will be routed to parent object, but I would prefer defining separate Changed
property for such kind of things.
public bool StateChanged
{
get { return true; }
}
And subscribe to PropertyChanged
event within your class:
this.PropertyChanged += PropertyChangedHandler;
In handler notify that your object state changed:
private void PropertyChangedHandler(object sender, PropertyChangedEventArgs e)
{
if (!e.PropertyName.Equals("StateChanged"))
{
this.OnPropertyChanged("StateChanged");
}
}