1

我使用了 Silverlight 的列表选择器控件,并使用 bean 类在其中添加了一些值,但我无法在 Selection Changed 事件中获取项目的名称。我该怎么做呢?

4

1 回答 1

1

In the XAML:

<toolkit:ListPicker SelectionChanged="OnListPickerChanged" />

And in the code-behind:

private void OnListPickerChanged(object sender, SelectionChangedEventArgs e)
{
    var selectedItem = (sender as ListPicker).SelectedItem;
    // Do what you want with selectedItem
}
于 2013-02-04T13:26:25.067 回答