WPF的绑定是双向的,你可以设置小控件依赖属性的绑定都大控件上,比如
DP={Binding ElementName=ControlName, Path=.}
如果你说的大控件是父控件,你可以使用RelativeResource,比如
DP={Binding RelativeResource={RelativeResource .....}, Path = ...}.
第三种方式就是将大控件和小控件的属性都绑定到同一个数据源,这样也可以实现你说的绑定。
Sheldon _Xiao[MSFT]
MSDN Community Support |
Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
![]()