public VisualPolygonalBuilding(IBuildingEntity mapEntity) : base() { _polygonBuildingSource = new VisualPolygon(mapEntity); _polygonBuildingSource.PropertyChanged += _polygonBuildingSource_PropertyChanged; // setup TerrainEnabled = false; _buildingSource = mapEntity; Floors = new ObservableCollection <VisualFloor>(); // Commands AddFloorCommand = new AddFloorCommand(this); // fill floors FillFromSource(); Floors.CollectionChanged += Floors_CollectionChanged; MapEntities = MapEntities; if (Floors.Count > 0) { CurrentFloor = Floors[0]; } }
public async Task <IActionResult> AddNewFloor([FromBody] AddFloorCommand data) { var res = await Mediator.Send(data); return(res == null ? (IActionResult)BadRequest("Unable to update the date") : Ok(res)); }