What about navigation from the view model? I found that blazors NavigationManager can only work if injected in to razor component. If injected to any other class it throws an exception. Is there a way to handle navigation by from the view model? For example I want to on button click execute a command that calls some service and then navigates me to another page.
it's a bit late but if anyone still looking for the answer, we can create an interface and inject it to the vm, then in the implementation of the interface (which we put in client project), inject NavigationManager and implement methods for navigation
Hi @rogersteinbakk, I reached out to Kelly, the presenter, with your question! This is what he said, "Hmmm, I haven't tried it with Blazor Server, I guess theoretically it would work, but sending all that Observable state back and forth over the internet seems like it would be slow."
So glad to see that someone has found and shared a simple MMVM solution for Blazor!
Great example of getting started with Blazor and MVVM Toolkit, thanks!
Thank you! Now I can confidently use Blazor!
What about navigation from the view model? I found that blazors NavigationManager can only work if injected in to razor component. If injected to any other class it throws an exception. Is there a way to handle navigation by from the view model? For example I want to on button click execute a command that calls some service and then navigates me to another page.
Any update on this?
it's a bit late but if anyone still looking for the answer, we can create an interface and inject it to the vm, then in the implementation of the interface (which we put in client project), inject NavigationManager and implement methods for navigation
This looks great! How would I go about injecting services in through the constructors of the view models?
MVVM toolkit is great. Can this be useful for Blazor server as well, or only for WASM?
Hi @rogersteinbakk, I reached out to Kelly, the presenter, with your question! This is what he said, "Hmmm, I haven't tried it with Blazor Server, I guess theoretically it would work, but sending all that Observable state back and forth over the internet seems like it would be slow."
@@IntelliTect Thanx for responding! :)
what if we have more complex data, for example nested complex objects in which also smth changes. how does mvvmcomponentbase know about it?