using SewerStammGen.Shared.Contracts;
using SewerStammGen.WPF.Interface.Navigator;
using SewerStammGen.WPF.ViewModel;
using SewerStammGen.WPF.ViewModel.State;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SewerStammGen.WPF.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();
        }
    }
}
