【发布时间】:2017-07-05 12:58:28
【问题描述】:
问题简介
我在视图模型中的一个属性上的 XAML 中有一个绑定,称为“IsYoungerThanSeventy”。 Iøm 使用 Prism 对事件 TargetUpdated 调用命令。目前我正在使用TriggerParameterPath="Source" 传递Source(BinaryQuestion)。
问题
我不能同时通过Source 和Property
我想做的事
我还想将Property (IsYoungerThanSeventy) 传递给同一命令。
最后,我在调用更新内容的函数中同时需要 Source 和 Property。
到目前为止我的代码
<wpfQuestionnaire:BinaryQuestion
AnswerRequired="{Binding IsYoungerThanSeventy
, Mode=TwoWay
, NotifyOnTargetUpdated=True}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="TargetUpdated">
<prism:InvokeCommandAction
Command="{Binding PropertyBoundToAnswerRequiredChangedCommand}"
TriggerParameterPath="Source"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</wpfQuestionnaire:BinaryQuestion>
【问题讨论】:
-
Source是什么?你不是已经拥有它了吗(它是执行命令的虚拟机)。我希望 Quiz 有一系列问题,那么你可能有当前问题,其中包含类似这样的答案的集合。