private ExperimentDifficultyEstimateLayout newItem(SuggestedMetric metric, ActivityDatabase activityDatabase)
        {
            Activity activity = activityDatabase.ResolveDescriptor(metric.ActivityDescriptor);
            ExperimentDifficultyEstimateLayout item = new ExperimentDifficultyEstimateLayout(metric, activity);

            item.DifficultyText_Changed += Item_DifficultyText_Changed;
            return(item);
        }
        private void submit(List <ExperimentDifficultyEstimateLayout> reorderedItems)
        {
            if (!this.isValidOrder(reorderedItems))
            {
                return;
            }
            List <SuggestedMetric> results = new List <SuggestedMetric>();

            for (int i = 0; i < reorderedItems.Count; i++)
            {
                ExperimentDifficultyEstimateLayout item = reorderedItems[i];
                results.Add(item.SuggestedMetric);
            }
            int requiredNumChoices = 3;

            if (results.Count != requiredNumChoices)
            {
                throw new ArgumentException("ExperimentationDifficultySelectionLayout unsupported number of choices: got " + results.Count + ", expected " + requiredNumChoices);
            }
            this.Done.Invoke(results);
        }