I'm developing a WPF application which reads and writes XML data.
I'm coming from an MVC background and I want to take an MVVM approach.
In the last MVC project I worked on I would use the repository pattern to get the data. The Controller would have an interface to a Service which would in turn have an interface to the Repository. The repository would get the data and return it back to the controller which would populate a ViewModel to be passed to the View.
I'm wondering
- Should I should take a similar approach here?
- Should I implement a Repository Pattern.
- If so, would I have an interface to the service in e.g. a button click event?
- Should I populate the ViewModel in the button click event or in the Service?
If I shouldn't use the Repository Pattern, what's the best approach for retrieving the XML data?