public TowerTankEditor() { InitializeComponent(); ModifiedTowerTank = new TowerTank(); mainGrid.DataContext = ModifiedTowerTank; Save.Click += Save_Click; }
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); }