Summary
We've made quite a bit of progress with the application in this chapter. While it's not yet connected to a live data source, we have methods in place to add and remove items from the media collection in memory. In addition, the project has been refactored to use the MVVM pattern, moving all of the existing view logic from the MainPage
code-behind file to a new MainViewModel
class. The new MainViewModel
class has no dependencies on the UI. This decoupling allowed us to effectively unit test our application logic. We added a unit test project to the solution with a suite of five unit tests, covering a majority of the MainViewModel
logic. These good software design habits will serve us well in the chapters ahead as we build on more functionality to the project.
In the next chapter, we will continue learning how to use the MVVM pattern to write robust, maintainable WinUI applications. We will cover some more advanced MVVM topics and learn some additional techniques...