/// SelectedItem property
/// </summary>
public static readonly BindableProperty SelectedItemProperty =
- BindableProperty.Create(nameof(SelectedItem), typeof(object), typeof(BindableRecyclerView), null, propertyChanged: OnSelectedItemChanged);
+ BindableProperty.Create(nameof(SelectedItem), typeof(object), typeof(BindableRecyclerView), null, propertyChanged: OnSelectionChanged);
/// <summary>
/// SelectionMode property
/// </summary>
public static readonly BindableProperty SelectionModeProperty =
- BindableProperty.Create(nameof(SelectionMode), typeof(RecyclerViewSelectionMode), typeof(BindableRecyclerView), RecyclerViewSelectionMode.None, propertyChanged: OnSelectionModeChanged);
+ BindableProperty.Create(nameof(SelectionMode), typeof(RecyclerViewSelectionMode), typeof(BindableRecyclerView), RecyclerViewSelectionMode.None, propertyChanged: OnSelectionChanged);
private TapGestureDetector detector;
}
}
- public static void OnSelectedItemChanged(BindableObject bindable, object oldValue, object newValue)
+ public static void OnSelectionChanged(BindableObject bindable, object oldValue, object newValue)
{
- var recycler = bindable as BindableRecyclerView;
- if (recycler != null)
- {
- recycler.EvaluateSelection();
- }
- }
-
- public static void OnSelectionModeChanged(BindableObject bindable, object oldValue, object newValue)
- {
- if (bindable is BindableRecyclerView recycler && newValue is RecyclerViewSelectionMode mode)
+ if (bindable is BindableRecyclerView recycler)
{
recycler.EvaluateSelection();
}