財產在我的XAML中我有這樣的列表視圖:綁定的SelectedItem對VM
<ListView HorizontalAlignment="Left"
Height="355"
Margin="144,373,0,0"
VerticalAlignment="Top"
Width="154"
ItemsSource="{Binding People}"
SelectedItem="{Binding SelectedItem}"
ItemTemplate="{StaticResource Standard310x260ItemTemplate}"/>
而且在我的虛擬機,我有這個屬性:
private Person _selectedItem;
public Person SelectedItem
{
get
{
return _selectedItem;
}
set
{
if (_selectedItem == value || value == null)
{
return;
}
var oldValue = _selectedItem;
_selectedItem = value;
// Update bindings, no broadcast
RaisePropertyChanged("SelectedItem");
}
}
什麼IM希望的是,的SelectedItem屬性在我的虛擬機上會更新,每當我點擊列表視圖中的項目。有人能看到我在這裏失蹤了嗎?
介紹如何處理人民財產 – Sievajet