Open michaelb4 opened 7 years ago
In the OnSelectedItemChanged event, should the SelectedIndex be set to -1 when SelectedItem == null?
private static void OnSelectedItemChanged(BindableObject bindable, object oldValue, object newValue) { BindablePicker picker = (BindablePicker)bindable; picker.SelectedItem = newValue; if (picker.ItemsSource != null && picker.SelectedItem != null) { int count = 0; foreach (object obj in picker.ItemsSource) { if (obj == picker.SelectedItem) { picker.SelectedIndex = count; break; } count++; } } }
For instance: else picker.SelectedIndex = -1;
Thank you for your consideration.
In the OnSelectedItemChanged event, should the SelectedIndex be set to -1 when SelectedItem == null?
private static void OnSelectedItemChanged(BindableObject bindable, object oldValue, object newValue) { BindablePicker picker = (BindablePicker)bindable; picker.SelectedItem = newValue; if (picker.ItemsSource != null && picker.SelectedItem != null) { int count = 0; foreach (object obj in picker.ItemsSource) { if (obj == picker.SelectedItem) { picker.SelectedIndex = count; break; } count++; } } }
For instance: else picker.SelectedIndex = -1;
Thank you for your consideration.