using StammGenerator.Commands;
using StammGenerator.Interface;
using StammGenerator.ViewModel;
using System.Threading.Tasks;

namespace StammGenerator.Commands
{
    internal class HaltungEditCommand : AsyncCommandBase
    {
        
        private IActualState actualState;
        private IRenavigator renavigator;
        private HaltungListViewModel haltungListViewModel;


        public HaltungEditCommand(IActualState actualState, IRenavigator renavigator, HaltungListViewModel haltungListViewModel)
        {
            
            this.actualState = actualState;
            this.renavigator = renavigator;
            this.haltungListViewModel = haltungListViewModel;
        }

        public override async Task ExecuteAsync(object? parameter)
        {
            actualState.SetHaltung(haltungListViewModel.SelectedHaltung);
            renavigator.Renavigate();
        }
    }
}
