protected BuildingEventArgs OnNewBuildingRequested() { BuildingEventArgs result = null; BuildingEventHandler newBuildingRequested = NewBuildingRequested; if (newBuildingRequested != null) { BuildingEventArgs args = null; result = newBuildingRequested(this, args); } return(result); }
// Adds a new building and calls to make a VM model for it, then adds it to list of buildings and updates UI public void AddBuilding() { BuildingEventArgs e = OnNewBuildingRequested(); if (e != null) { VMBuilding b = new VMBuilding(ct.AddBuilding(e.Name)); _selectedVMBuilding = b; BuildingsVM.Add(_selectedVMBuilding); OnItemsChanged(SelectedVMBuilding); } _selectedVMCustomer.AddBuilding(_selectedVMBuilding); }