private void AddPeriodeTemplateCommand_Executed(object prm) { var dtm = new TLCGenTemplateModel <PeriodeModel>(); dtm.Naam = "Nieuw template"; dtm.Replace = "fase"; var dm = new PeriodeModel(); dm.Naam = "fase_1"; DefaultsProvider.Default.SetDefaultsOnModel(dm, "Auto"); dtm.Items.Add(dm); PeriodenTemplates.Add(new PeriodeTemplateViewModel(dtm)); MessengerInstance.Send(new TemplatesChangedMessage()); }
private void AddPeriodeTemplateCommand_Executed(object prm) { var pmt = new TLCGenTemplateModel <PeriodeModel> { Naam = "Nieuw template" }; var pm = new PeriodeModel { DagCode = Models.Enumerations.PeriodeDagCodeEnum.AlleDagen, Type = Models.Enumerations.PeriodeTypeEnum.Groentijden, Naam = "per_1" }; DefaultsProvider.Default.SetDefaultsOnModel(pm, pm.Type.ToString()); pmt.Items.Add(pm); var pvm = new PeriodeTemplateViewModel(pmt); PeriodenTemplates.Add(pvm); TemplatesProvider.Default.LoadedTemplates.First(x => x.Editable).Templates.PeriodenTemplates.Add(pmt); MessengerInstance.Send(new TemplatesChangedMessage()); SelectedPeriodeTemplate = pvm; }