I injected the NavigationManager in my view Blazor Razor component and is available to use it. I'm calling from View a method in VIewModel that needs to use NavigationManager. I used [Inject] attribute to initialize the NavigationManager public property, but it is not getting injected.
One approach is to pass NaviagtionManger to VIewModel or set the navigationmanager property in VIewModel from View.
Is there a different better way to do it?
a.Razor Injects the NaviagtionManagaer using @Inject and is available within the view.
aViewModel.cs tries to Inject the NaviagtionManager and is not doing it and is not available.