【发布时间】:2015-12-10 13:53:43
【问题描述】:
我已经浏览了足够多的 InterWebs!我希望在这里解决这个问题。
我有两个父用户控件,ParentUc1 和 ParentUc2。它们都包含一个ChildUc。
除了 XAML 代码之外,不添加任何代码,我想设置来自每个父母的 ChildUc 中的 SensorRotationAngle 绑定的值。
ParentUc1:
将 SensorRotationAngle 设置为 10
ParentUc2:
将 SensorRotationAngle 设置为 20
ChildUc:
<Rectangle>
<Rectangle.RenderTransform>
<RotateTransform Angle="{Binding SensorRotationAngle}" />
</Rectangle.RenderTransform>
</Rectangle>
谢谢!
【问题讨论】:
标签: wpf xaml binding user-controls