예제 #1
0
        public void SetDataContextFrom(ShipOrderVM shipOrderVM)
        {
            CargoStorageVM vm = new CargoStorageVM(shipOrderVM.GameVM);

            vm.Initialise(shipOrderVM.SelectedShip);
            DataContext = vm;
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }
예제 #4
0
 public ShipMoveView(ShipOrderVM viewModel) : this()
 {
     DataContext = viewModel;
 }
예제 #5
0
 public ShipAttackView(ShipOrderVM viewModel) : this()
 {
     DataContext = viewModel;
 }
예제 #6
0
 public ShipFireControlView(ShipOrderVM viewModel) : this()
 {
     DataContext = viewModel;
 }