private void setupMiscVM() { MiscVM = new MiscCostsVM(Bid); MiscVM.SelectionChanged += misc => { Selected = misc; }; }
public MaterialVM(TECTemplates templates) { ReferenceDropHandler = new ReferenceDropper(templates); Templates = templates; //Setup VMs subscribeToVM(DeviceVM = new DevicesCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(ValveVM = new ValvesCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(ConnectionTypeVM = new ConnectionTypesCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(ConduitTypeVM = new ConduitTypesCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(ControllerTypeVM = new ControllerTypesCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(PanelTypeVM = new PanelTypesCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(AssociatedCostVM = new AssociatedCostsCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(IOModuleVM = new IOModulesCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(ManufacturerVM = new ManufacturersCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(TagVM = new TagsCatalogVM(templates, ReferenceDropHandler)); subscribeToVM(MiscVM = new MiscCostsVM(templates)); subscribeToVM(ProtocolVM = new ProtocolsCatalogVM(templates, ReferenceDropHandler)); }
private void SystemSelected(TECSystem value) { if (value != null) { MiscVM = new MiscCostsVM(value); ControllersPanelsVM = new ControllersPanelsVM(value, scopeManager); ValveVM = new ValveSelectionVM(value, scopeManager.Catalogs.Valves); ConnectionsVM = new ConnectionsVM(value, new ChangeWatcher(value), catalogs, locations: (scopeManager as TECBid)?.Locations, filterPredicate: connectionFilter); if (value is TECTypical typical && typical.Instances.Count > 1) { UpdateInstanceConnectionsCommand = new RelayCommand(typical.UpdateInstanceConnections, typical.CanUpdateInstanceConnections); } else { UpdateInstanceConnectionsCommand = null; } RaisePropertyChanged("UpdateInstanceConnectionsCommand"); bool connectionFilter(ITECObject obj) { if (obj is ITypicalable typ && typ.IsTypical == value.IsTypical) { return(true); }