public TankDestroyerEditor() { InitializeComponent(); ModifiedTankDestroyer = new TankDestroyer(); mainGrid.DataContext = ModifiedTankDestroyer; Save.Click += Save_Click; }
public VehicleEditorControl CreateEditor(Vehicle vehicle, IList <Module> modules) { if (!IsValidVehicle(vehicle)) { throw new ArgumentException("Invalid vehicle"); } var editor = new TankDestroyerEditor(); editor.Modules = modules; TankDestroyer targetTankDestroyer = vehicle as TankDestroyer; editor.TankDestroyer = targetTankDestroyer; editor.SaveCommand = new SaveEdittedVehicleCommand <TankDestroyer>(targetTankDestroyer, editor.ModifiedTankDestroyer); return(editor); }