Exemple #1
0
        private void LongPressMethod(UILongPressGestureRecognizer gestureRecognizer)
        {
            var p = gestureRecognizer.LocationInView(Control);
            var longPressOnTheList = Control.IndexPathForRowAtPoint(p);

            if (longPressOnTheList == null)
            {
                return;
            }

            // if a the long press is on a row on the listView
            var counter = 0;

            foreach (var item in list.ItemsSource)
            {
                if (counter == longPressOnTheList.Row)
                {
                    list.OnLongClicked(item);
                    break;
                }
                counter += 1;
            }
        }