0
試圖在WPF chekbox
的click
或checked
事件的command
綁定在我的視圖模型,但即時通訊上的技術和事件名稱,任何人都可以點我在正確的方向不確定?WPF複選框,觸發器
對於現在的代碼編譯,但在trigger
不會調用FooCommand
<CheckBox IsChecked="{Binding PartData.ReportIncluded, Mode=TwoWay}"
VerticalAlignment="Center">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown" >
<i:InvokeCommandAction Command="{Binding FooCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</CheckBox>
嘗試OnMouseLeftButton和OnPreviewMouseLeftButtonDown和OnChecked,什麼都不起作用 – klashagelqvist 2012-07-06 07:40:18
i:Interaction.Triggers是否適用於其他控件上的evens? – Josh 2012-07-06 13:10:10
感謝您的anwswers,如果發現它,觸發器在具有自己的datacontext的hirearciacal數據模板中,而fooCommand在usercontrol數據環境中,這就是爲什麼它永遠不會被稱爲 – klashagelqvist 2012-07-06 13:25:11