开发者

Trigger not updating dependency property after value has been set in code

开发者 https://www.devze.com 2023-04-05 11:14 出处:网络
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 trigge

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消