예제 #1
0
        public override void RemoveFromCollection()
        {
            int collectionItemCollectionCount = currentProvider.GetCollectionChildCollectionCount(CollectionIndex);
            int collectionItemItemCount       = currentProvider.GetCollectionItemCount(CollectionIndex);

            if (collectionItemCollectionCount > 0 || collectionItemItemCount > 0)
            {
                string message = collectionNotEmtyMessage.FormatWith(currentProvider.GetCollectionItem(CollectionIndex).Name);
                UiThread.RunOnIdle(() =>
                {
                    // Let the user know this collection is not empty and check if they want to delete it.
                    StyledMessageBox.ShowMessageBox(ProcessDialogResponse, message, collectionNotEmtyTitle, StyledMessageBox.MessageType.YES_NO, deleteNow, doNotDelete);
                });
            }
            else
            {
                currentProvider.RemoveCollection(CollectionIndex);
            }
        }