【发布时间】:2013-04-20 07:51:28
【问题描述】:
当触发器出现在 ViewModel 中时,我遇到了一个问题,SelectedItem(parameter) 来自先前选择的项目。我需要新选择的项目作为 selectionChanged 的参数。
我是 WP8 的新手。下面是代码
<toolkit:ListPicker Header="Background"
ExpansionMode="FullscreenOnly"
Template="{StaticResource ListPickerControlTemplate}"
VerticalAlignment="Top"
ItemsSource="{Binding Path=Buildings.ObjectList}"
Margin="0"
x:Name="buldings"
Padding="0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding Path=BuildingSelectionCommand}"
CommandParameter="{Binding Path=SelectedItem, ElementName=buldings}" />
</i:EventTrigger>
</i:Interaction.Triggers>
谢谢 维诺德
【问题讨论】:
标签: xaml mvvm windows-phone-8 windows-phone eventtrigger