我在wpf中有一個tabcontrol,我想在選項卡選擇更改時向我的viewmodel發送一個觸發器。該trig應該包含選項卡名稱或選項卡索引。Wpf tabcontrol trig參數
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding Path=TabChangedCommand}"
CommandParameter="{Binding ElementName=TabControl, Path=Name}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
觸發器工作正常,但參數始終爲空。
分享您的TabControl – 2015-03-13 08:06:32
郵政XAML完全的TabControl和視圖模型的代碼。 – sthotakura 2015-03-13 09:02:10