嗨!我有一个扩展器和一个TextBox。我想在扩展器展开时禁用TextBox,而在未展开时启用它。如何做到这一点?我尝试过这样的东西:
<TextBox IsEnabled="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}, AncestorLevel=1},Path=IsExpanded}" />但反之亦然。
发布于 2009-08-18 09:51:17
尝试删除AncestorLevel属性,这很容易出错,而且通常不是必需的
https://stackoverflow.com/questions/1292898
复制相似问题