public WorkoutPartWrapper(WorkoutWrapper parent, WorkoutPart element)
     : base(parent, element)
 {
 }
        private WorkoutWrapper GetWorkoutWrapper(Workout workout, ActivityCategoryWrapper parent)
        {
            WorkoutWrapper wrapper = null;

            if (GarminWorkoutManager.Instance.Workouts.Contains(workout))
            {
                // If we already have a wrapper for this workout, use it
                if (m_WorkoutWrapperMap.ContainsKey(workout))
                {
                    wrapper = m_WorkoutWrapperMap[workout];
                }
                else
                {
                    // Create a new wrapper
                    wrapper = new WorkoutWrapper(parent, workout);

                    m_WorkoutWrapperMap[workout] = wrapper;
                }
            }

            return wrapper;
        }
        private void AddWorkoutPartsToList(WorkoutWrapper parent, List<WorkoutPart> parts)
        {
            foreach (WorkoutPart part in parts)
            {
                WorkoutPartWrapper wrapper = GetWorkoutPartWrapper(part, parent);

                parent.Children.Add(wrapper);
                wrapper.Parent = parent;
            }
        }
        private WorkoutPartWrapper GetWorkoutPartWrapper(WorkoutPart workoutPart, WorkoutWrapper parent)
        {
            WorkoutPartWrapper wrapper = null;

            // If we already have a wrapper for this workout, use it
            if (m_WorkoutPartWrapperMap.ContainsKey(workoutPart))
            {
                wrapper = m_WorkoutPartWrapperMap[workoutPart];
            }
            else
            {
                // Create a new wrapper
                wrapper = new WorkoutPartWrapper(parent, workoutPart);

                m_WorkoutPartWrapperMap[workoutPart] = wrapper;
            }

            return wrapper;
        }