public AnAdditionalLoadsView(LoadTypes type) { _id = Guid.NewGuid(); switch (type) { // Todo: case for each case LoadTypes.Cooling: DistrictControl.Instance.ListOfDistrictLoads.Add(new AdditionalLoads(LoadTypes.Cooling) { Id = _id, Name = "Additional Cooling Load" }); break; case LoadTypes.Elec: DistrictControl.Instance.ListOfDistrictLoads.Add(new AdditionalLoads(LoadTypes.Elec) { Id = _id, Name = "Additional Electricity Load" }); break; case LoadTypes.Heating: DistrictControl.Instance.ListOfDistrictLoads.Add(new AdditionalLoads(LoadTypes.Heating) { Id = _id, Name = "Additional Heating Load" }); break; } InitializeComponent(); DataContext = new AnAdditionalLoadViewModel { Id = _id }; }
public Demands() { InitializeComponent(); DataContext = new AnAdditionalLoadViewModel(); UmiEventSource.Instance.ProjectClosed += ClearThis; }