且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在ControlTemplate中读取AttachedProperty时遇到问题

更新时间:2023-01-23 18:20:43

您在按钮上设置了值,该值即被附加,因此:

You set the value on the button, and it is attached, hence:

{Binding RelativeSource={RelativeSource AncestorType=Button},
         Path=(local:MyButtonThing.Text2)}