I would like to determine the name of the item that is currently selected in a ListPicker. I am not sure what to do in the SelectionChanged event to get the name of the item.
XAML
<Grid.Resources>
<DataTemplate x:Name="PickerItemTemplate">
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</Grid.Resources>
<toolkit:ListPicker x:Name="ThemeListPicker" Header="{Binding Path=LocalizedResources.SettingsPage_ThemeListPicker_Header, Source={StaticResource LocalizedStrings}}"
ItemTemplate="{StaticResource PickerItemTemplate}"
SelectionChanged="ThemeListPicker_SelectionChanged"/>
XAML.CS
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
themeList = new List<Theme>();
themeList.Add(new Theme() { Name = "light" });
themeList.Add(new Theme() { Name = "dark" });
ThemeListPicker.ItemsSource = themeList;
}
private void ThemeListPicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//get the name of the current item in the listpicker?
}