Spokane .NET Conference: MVVM in Blazor WASM with the Community Toolkit
2023 ж. 22 Нау.
7 917 Рет қаралды
Like Blazor but find it hard to test your code-behind? Are you a principled MVVM desktop developer but yearn to write web apps?
The .NET Community Toolkit is a platform-agnostic MVVM (Model/View/ViewModel) framework that makes implementing that pattern a breeze. If you're a web developer looking to adopt the MVVM methodology or a desktop developer looking to build a web app, this talk is for you. Come and learn why Senior Software Developer Kelly Adams loves utilizing it in a ASP.NET Blazor WASM (WebAssembly) application to improve testability, code re-use, and adherence to SOLID principles.
Repo - github.com/IntelliTect-Sample...
For more info go to www.meetup.com/spokane-net-us...
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!
This looks great! How would I go about injecting services in through the constructors of the view models?
what if we have more complex data, for example nested complex objects in which also smth changes. how does mvvmcomponentbase know about it?
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?
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! :)