Example #1
0
        public void RemoveSuperSet(StrengthTrainingItemViewModel item)
        {
            string supersetGroup = item.Item.SuperSetGroup;

            item.RemoveSuperSet();
            List <StrengthTrainingItemViewModel> itemsInGroup = new List <StrengthTrainingItemViewModel>();

            foreach (var itemViewModel in _exercises)
            {
                if (itemViewModel.Item.SuperSetGroup == supersetGroup)
                {
                    itemsInGroup.Add(itemViewModel);
                }
            }
            if (itemsInGroup.Count == 1)
            {//there is only one exercise in the group so we can remove the group
                itemsInGroup[0].RemoveSuperSet();
            }
        }