PathForRadio() private method

private PathForRadio ( int idx ) : NSIndexPath
idx int
return NSIndexPath
Example #1
0
        public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath indexPath)
        {
            RootElement     root = (RootElement)Parent.Parent;
            UITableViewCell cell = null;

            if (RadioIdx != root.Value)
            {
                var indexForOldItem = root.PathForRadio(root.Value);
                if (indexForOldItem != null)
                {
                    cell = tableView.CellAt(indexForOldItem);
                    if (cell != null)
                    {
                        cell.Accessory = UITableViewCellAccessory.None;
                    }
                }
                cell = tableView.CellAt(indexPath);
                if (cell != null)
                {
                    cell.Accessory = UITableViewCellAccessory.Checkmark;
                }
                root.Value = RadioIdx;
            }

            base.Selected(dvc, tableView, indexPath);

            if (PopOnSelect)
            {
                dvc.NavigationController.PopViewControllerAnimated(true);
            }
        }
Example #2
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            if (AutoHideSearch)
            {
                if (enableSearch)
                {
                    this.ClearSearchBar();
                }
            }

            NavigationItem.HidesBackButton = !pushing;

            if (root == null)
            {
                return;
            }

            root.Prepare();

            if (root.Caption != null)
            {
                NavigationItem.Title = root.Caption;
            }

            if (root.CaptionPrompt != null)
            {
                this.NavigationItem.Prompt = root.CaptionPrompt;
            }
            if (dirty)
            {
                tableView.ReloadData();
                dirty = false;
            }

            try {
                tableView.ScrollToRow(root.PathForRadio(root.Value), UITableViewScrollPosition.Middle, false);
            } catch (Exception) {}
        }