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
{
    class SchachtEditCommand : AsyncCommandBase
    {

        private IActualState actualState;
        private IRenavigator renavigator;
        private ManholeListViewModel manholeListViewModel;

        public SchachtEditCommand(IActualState actualState, IRenavigator renavigator, ManholeListViewModel manholeListViewModel)
        {
            this.actualState = actualState;
            this.renavigator = renavigator;
            this.manholeListViewModel = manholeListViewModel;
        }

        public override async Task ExecuteAsync(object? parameter)
        {
            actualState.SetSchacht(manholeListViewModel.SelectedSchacht);
            renavigator.Renavigate();
        }
    }
}
