A class
public class A
{
public int id{get;set;}
public string name {get;set;}
}
XAML
<Picker x:name="picker1" ItemsDisplayBinding = "{Binding name}" ItemsSource="{Binding SomeClass}" SelectedIndexedChanged="fun"/>
<Picker x:name="picker2" ItemsDisplayBinding = "{Binding some_val}" ItemsSource="{Binding A}"
XAML.cs
fun()
{
var value = picker1.Items[picker1.SelectedIndex];
}
In Picker 1 if I set ItemsDisplayBinding = {Binding name}, then the value in the picker contains "NAMES"
In Picker 1 if I set ItemsDisplayBinding = {Binding id}, then the value in the picker contains "ID"
The issue is I want to DISPLAY "names" in picker1 but want the value of the corrosponding "ID". How is this possible?