Blog.Mobile.Components.CustomPicker.OnSelectedItemPropertyChanged C# (CSharp) Method

OnSelectedItemPropertyChanged() private static method

Called when [selected item property changed].
private static OnSelectedItemPropertyChanged ( BindableObject bindable, object value, object newValue ) : void
bindable BindableObject The bindable.
value object The value.
newValue object The new value.
return void
        private static void OnSelectedItemPropertyChanged(BindableObject bindable, object value, object newValue)
        {
			var picker = (CustomPicker)bindable;
            if (picker.ItemsSource != null)
                picker.SelectedIndex = picker.ItemsSource.IndexOf(picker.SelectedItem);
        }