To handle the selection change event of a Picker in XAML:
XAML:
<Picker x:Name="myPicker" SelectedIndexChanged="OnSelectedIndexChanged" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Mark</x:String>
<x:String>Jack</x:String>
<x:String>Annie</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
C#
private void OnSelectedIndexChanged(object sender, EventArgs e)
{
var selectedValue = myPicker.SelectedItem.ToString();
}
Share with