Working with Remote Data
So far, we’ve dug deep into MVVM and .NET MAUI, covering everything from the basics of the MVVM design, from data binding and Dependency Injection to navigation and handling user input. But there’s one big piece of the puzzle we haven’t tackled yet: getting data from the internet.
It’s hard to imagine an app these days that doesn’t talk to an online service to grab fresh data. Adding backend communications also means we need to tackle some architectural challenges such as maintaining separation of concerns, building your app with maintainability in mind, and so on.
Here’s what we’ll dive into in this chapter:
- Revisiting the model architecture
- API communication with Refit
- API communication from ViewModels
By the end of this chapter, our Recipes! app will be more than just a standalone thing. It’ll communicate with a backend service to fetch fresh data and push updates. We’...