using StammGenerator.Interface;

namespace StammGenerator.ViewModel
{
    internal class ViewModelDelegateRenavigator<TViewModel> : IRenavigator where TViewModel : BaseViewModel
    {
        private readonly IMainWindowNavigator _navigator;
        private readonly CreateViewModel<TViewModel> _createViewModel;

        public ViewModelDelegateRenavigator(IMainWindowNavigator navigator, CreateViewModel<TViewModel> createViewModel)
        {
            _navigator = navigator;
            _createViewModel = createViewModel;
        }
        public void Renavigate()
        {
            _navigator.CurrentViewModel = _createViewModel();
        }
    }
}
