繁体   English   中英

WPF RelativeSource绑定问题

[英]WPF RelativeSource binding question

嗨! 我有一个扩展器和一个文本框。 我想在扩展器展开时禁用TextBox,而在未扩展时启用。 怎么做? 我已经尝试过这样的事情:

<TextBox IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}, AncestorLevel=1},Path=IsExpanded}" />

但是反之亦然。

尝试删除AncestorLevel属性,它很容易出错,通常不需要

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM