Пример #1
0
		public void SendCellDisappearing(Cell cell)
			=> ItemDisappearing?.Invoke(this, new ItemVisibilityEventArgs(cell.BindingContext, TemplatedItems.GetGlobalIndexOfItem(cell?.BindingContext)));
Пример #2
0
        public void NotifyRowTapped(int groupIndex, int inGroupIndex, Cell cell = null)
        {
            var group = TemplatedItems.GetGroup(groupIndex);

            bool changed = _previousGroupSelected != groupIndex || _previousRowSelected != inGroupIndex;

            _previousRowSelected   = inGroupIndex;
            _previousGroupSelected = groupIndex;

            // A11y: Keyboards and screen readers can deselect items, allowing -1 to be possible
            if (cell == null && inGroupIndex >= 0)
            {
                cell = group[inGroupIndex];
            }

            // Set SelectedItem before any events so we don't override any changes they may have made.
            if (SelectionMode != ListViewSelectionMode.None)
            {
                SetValueCore(SelectedItemProperty, cell?.BindingContext, SetValueFlags.ClearOneWayBindings | SetValueFlags.ClearDynamicResource | (changed ? SetValueFlags.RaiseOnEqual : 0));
            }

            cell?.OnTapped();

            ItemTapped?.Invoke(this, new ItemTappedEventArgs(ItemsSource.Cast <object>().ElementAt(groupIndex), cell?.BindingContext, TemplatedItems.GetGlobalIndexOfItem(cell?.BindingContext)));
        }