8,757
社区成员
发帖
与我相关
我的任务
分享<Condition Binding="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.IsDiscussionCreateUser}" Value="true"></Condition>
我只是需要IsDiscussionCreateUser这个变量来做触发器的判断[/quote]
尽量使用一个DataContext 来实现功能; 它这段代码的意思就是向上查询类型为Window的祖先元素,使用它的DataContext,就是对应的ViewModel 来显示那个属性。<Condition Binding="{Binding RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.IsDiscussionCreateUser}" Value="true"></Condition>
我只是需要IsDiscussionCreateUser这个变量来做触发器的判断
求助啊