public PatternViewModel(Pattern pattern, Factories factories, IList<InsulinCircumstanceViewModel> allCircumstances, bool hasAlternatives, IEnumerable<MealNameViewModel> names, MealNameViewModel defaultName, Navigator navigator, Action save, Action showAlternatives) { Pattern = pattern; Match = new MealItemViewModel(pattern.Match, factories); From = new MealViewModel(pattern.From, factories); From.Names = names; From.DefaultName = defaultName; Insulin = new InsulinViewModel(pattern.Insulin, factories, allCircumstances: allCircumstances); Before = new SugarViewModel(pattern.Before, factories); After = pattern.After .Select(sugar => new SugarViewModel(sugar, factories)) .ToList(); For = new MealItemViewModel(pattern.For, factories); HasAlternatives = hasAlternatives; this.navigator = navigator; this.save = save; this.showAlternatives = showAlternatives; }
private Pattern BuildPattern() { pattern = new Pattern { Match = item, From = meal, Insulin = insulin, Before = sugarBefore, After = sugarsAfter, For = searchedItem }; DoActions(); return pattern; }
public ReplacementItem(Pattern pattern) { Pattern = pattern; }