Beispiel #1
0
        public TankDestroyerEditor()
        {
            InitializeComponent();

            ModifiedTankDestroyer = new TankDestroyer();

            mainGrid.DataContext = ModifiedTankDestroyer;

            Save.Click += Save_Click;
        }
Beispiel #2
0
        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);
        }