public void SetDataContextFrom(ShipOrderVM shipOrderVM) { CargoStorageVM vm = new CargoStorageVM(shipOrderVM.GameVM); vm.Initialise(shipOrderVM.SelectedShip); DataContext = vm; }
protected override void OnExecuted(EventArgs e) { base.OnExecuted(e); ShipOrderVM orderVM = ShipOrderVM.Create(_gameVM); Views.MainWindow mw = (Views.MainWindow)Application.Instance.MainForm.Content; mw.AddOrSelectTabPanel("Ship Order View", new Views.ShipView(orderVM)); // mw.AddOrSelectTabPanel("Ship Orders View", new Views.ShipOrderView(designVM)); }
public ShipView(ShipOrderVM viewModel) : this() { DataContext = viewModel; shipMoveView = new ShipMoveView(viewModel); shipFCView = new ShipFireControlView(viewModel); shipAttackView = new ShipAttackView(viewModel); cargoView = new CargoView.CargoStorageView(); //cargoView.SetDataContextFrom(viewModel); componentsView.DataContext = new ComponentDesignsListVM(viewModel.SelectedShip); viewModel.ShipList.SelectionChangedEvent += ShipList_SelectionChangedEvent; TabPage tpMove = new TabPage(); tpMove.Content = shipMoveView; tpMove.Text = "Move Orders"; shipview_tabs.Pages.Add(tpMove); TabPage tpFC = new TabPage(); tpFC.Content = shipFCView; tpFC.Text = "Fire Control Configuration"; shipview_tabs.Pages.Add(tpFC); TabPage tpAttack = new TabPage(); tpAttack.Content = shipAttackView; tpAttack.Text = "Attack Orders"; shipview_tabs.Pages.Add(tpAttack); TabPage tpCargo = new TabPage(); tpCargo.Content = cargoView; tpCargo.Text = "Cargo"; shipview_tabs.Pages.Add(tpCargo); TabPage tpComponents = new TabPage(); tpComponents.Content = componentsView; tpComponents.Text = "Components"; shipview_tabs.Pages.Add(tpComponents); }
public ShipMoveView(ShipOrderVM viewModel) : this() { DataContext = viewModel; }
public ShipAttackView(ShipOrderVM viewModel) : this() { DataContext = viewModel; }
public ShipFireControlView(ShipOrderVM viewModel) : this() { DataContext = viewModel; }