public void Execute(object parameter) { VehicleEditorControl editor = vehiclesTab.SelectedFactory.CreateNewEditor(vehiclesTab.Vehicles, vehiclesTab.Modules); VehiclesEditor editorWindow = new VehiclesEditor(editor); editor.AddOnSaveAction(() => editorWindow.Close()); editorWindow.ShowDialog(); }
public void Execute(object parameter) { try { VehicleEditorControl editor = vehiclesTab.VehicleEditorFactories.First(f => f.IsValidVehicle(vehiclesTab.SelectedVehicle)) .CreateEditor(vehiclesTab.SelectedVehicle, vehiclesTab.Modules); VehiclesEditor editorWindow = new VehiclesEditor(editor); editor.AddOnSaveAction(() => { editorWindow.Close(); }); editorWindow.ShowDialog(); } catch { } }