microsoft / XamlBehaviors

This is the official home for UWP XAML Behaviors on GitHub.
MIT License
697 stars 112 forks source link

UWP DataTriggerBehavior Not Firing #134

Closed matjd closed 6 years ago

matjd commented 6 years ago

I have a DataTriggerBehavior bound to a ViewModel Property, that is declared in a Style. I change the value of the Property, but the trigger never fires. Here is a sample project.

https://1drv.ms/f/s!AraXP7LtRcVmneRxjkjTORd5HeQH_A

Any thoughts ?

pedrolamas commented 6 years ago

The bindings on the DataTriggerBehavior on your sample are not correct, but I managed to make it work with this:

<core:DataTriggerBehavior
    Binding="{Binding FlashButton}"
    ComparisonCondition="Equal"
    Value="{Binding Name, RelativeSource={RelativeSource TemplatedParent}}">
    <core:GoToStateAction StateName="Flash" />
</core:DataTriggerBehavior>
matjd commented 6 years ago

Thank you so much.. fixed :)

pedrolamas commented 6 years ago

Glad it worked, please feel free to close this issue then! :)