private void HandleDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { var shipOrderViewModel = DataContext as ShipOrderViewModel; if (shipOrderViewModel == null) { throw new InvalidCastException("The data context should be correct type"); } _shipOrderViewModel = shipOrderViewModel; }
private void SetupShipOrderControl() { var shipOrderViewModel = new ShipOrderViewModel(_gameViewModel.SelectedShip, _gameViewModel.ShipOrderEditor); ShipOrderControl.DataContext = shipOrderViewModel; }
public async Task <IActionResult> Ship([FromBody] ShipOrderViewModel orderViewModel) { await _orderAppService.Ship(orderViewModel); return(Response(orderViewModel)); }
public Task Ship(ShipOrderViewModel customerViewModel) { var placeCommand = _mapper.Map <ShipOrderCommand>(customerViewModel); return(Bus.SendCommand(placeCommand)); }