Beispiel #1
0
        public void OnItemCheckedStateChanged(ActionMode mode, int position, long id, bool @checked)
        {
            // Here you can do something when items are selected/de-selected,
            // such as update the title in the CAB
            FListView.MarkItemAsSelected(position - 1, @checked);

            if (FListView.GetItemsSelectedCount() > 0)
            {
                mode.Title = $"{FListView.GetItemsSelectedCount()} seleccionados";
            }
            else
            {
                mode.Finish();
            }
        }
Beispiel #2
0
        protected void ItemLongPress(UILongPressGestureRecognizer gestureRecognizer)
        {
            if (gestureRecognizer.State == UIGestureRecognizerState.Began)
            {
                if (fListView.GetItemsSelectedCount() == 0)
                {
                    CGPoint     point     = gestureRecognizer.LocationInView(uiTableView);
                    NSIndexPath indexPath = uiTableView.IndexPathForRowAtPoint(point);

                    if (indexPath != null)
                    {
                        //fListView.MarkItemAsSelected(indexPath.Row, true);
                        uiTableView.Source.RowSelected(uiTableView, indexPath);
                        //uiTableView.SelectRow(indexPath, true, UITableViewScrollPosition.None);

                        ViewController.Title = "Probando";
                        ViewController.NavigationItem.Title            = "Probando";
                        UINavigationBar.Appearance.TitleTextAttributes = new UIStringAttributes
                        {
                            ForegroundColor = UIColor.Red
                        };
                    }
                }
            }
        }
Beispiel #3
0
        public void UpdateActionModeTitle()
        {
            if (fListView.GetItemsSelectedCount() > 0)
            {
                if (ActionMode == null)
                {
                    ActionMode = ((Activity)Context).StartActionMode(CreateActionMode());
                }
            }

            if (ActionMode != null)
            {
                if (fListView.GetItemsSelectedCount() > 0)
                {
                    ActionMode.Title = $"{fListView.GetItemsSelectedCount()} seleccionados";
                }
                else
                {
                    ActionMode.Finish();
                }
            }
        }