When a DataTriggerBehavior is bound to a non-static property, the order of initialization looks something like this:
Trigger properties defined in XAML (each calls OnValueChanged) -> Action properties defined in XAML (doesn't call OnValueChanged) -> DataContext (calls OnValueChanged)
However, when a static binding is used, the order of initialization becomes:
Static binding (calls OnValueChanged) -> Trigger properties defined in XAML (each calls OnValueChanged) -> Action properties defined in XAML (doesn't call OnValueChanged)
The important thing to note is that the last thing initialized in the latter case doesn't call OnValueChanged -- because of this, none of the triggers are properly invoked in this case.
To fix this, I added listeners to the ActionsCollection so that all properties of any attached Actions also cause an OnValueChanged call. This also fixes #53, since that was caused by bindings of Actions updating after Triggers were invoked.
Fixes #52
Fixes #53
EDIT: Sometimes AttachedObject is initialized last as well, so there needs to be a call to OnValueChanged in OnAttached() as well.
When a DataTriggerBehavior is bound to a non-static property, the order of initialization looks something like this:
However, when a static binding is used, the order of initialization becomes:
The important thing to note is that the last thing initialized in the latter case doesn't call OnValueChanged -- because of this, none of the triggers are properly invoked in this case.
To fix this, I added listeners to the ActionsCollection so that all properties of any attached Actions also cause an OnValueChanged call. This also fixes #53, since that was caused by bindings of Actions updating after Triggers were invoked.
Fixes #52 Fixes #53
EDIT: Sometimes AttachedObject is initialized last as well, so there needs to be a call to OnValueChanged in
OnAttached()
as well.