Пример #1
0
        public async override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            if (AllowSelection)
            {
                SelectedFace = Faces [indexPath.Row];

                var cell = collectionView.CellForItem(indexPath);
                cell.Highlighted = true;

                if (ReturnSegue != null)
                {
                    var result = await this.ShowTwoOptionAlert("Please choose", "Do you want to use this face?");

                    if (result)
                    {
                        PerformSegue(ReturnSegue, this);
                        //clean up, AFTER we've returned and any caller could get the thumbnail
                        cleanup();
                    }
                }
                else
                {
                    FaceSelectionChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }
Пример #2
0
        public override void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            if (AllowSelection)
            {
                SelectedFace = null;

                var cell = collectionView.CellForItem(indexPath);
                cell.Highlighted = false;

                FaceSelectionChanged?.Invoke(this, EventArgs.Empty);
            }
        }