Trigger not updating dependency property after value has been set in code
I have two con开发者_如何学运维trol template triggers (IsMouseOver and IsPressed). They set the Foo property correctly after the application starts. However, after i I have set Foo in code, the triggers cease to function (the set Foo is never called).
Why?
Triggers
have a lower precedence than explicitly set values, if you want to set a value which should be changeable by a Trigger
you can use a Setter
for example.
SetCurrentValue
might also work out depending on your needs.
精彩评论