Exemplo n.º 1
0
        public TowerTankEditor()
        {
            InitializeComponent();

            ModifiedTowerTank = new TowerTank();

            mainGrid.DataContext = ModifiedTowerTank;

            Save.Click += Save_Click;
        }
Exemplo n.º 2
0
        public VehicleEditorControl CreateEditor(Vehicle vehicle, IList <Module> modules)
        {
            if (!IsValidVehicle(vehicle))
            {
                throw new ArgumentException("Invalid vehicle");
            }

            var editor = new TowerTankEditor();

            editor.Modules = modules;

            TowerTank targetTowerTank = vehicle as TowerTank;

            editor.TowerTank   = targetTowerTank;
            editor.SaveCommand = new SaveEdittedVehicleCommand <TowerTank>(targetTowerTank, editor.ModifiedTowerTank);

            return(editor);
        }