I'm now trying to use the MVVM approach to display some hierarchical data but until now, I didn't implement any specific design pattern.
As simply as I can explain, I have 2 class libraries.
- Log.cs
- Backup.cs
And I have my WPF project.
Simply put, the Backup class performs some copy and paste functions. Each copy and paste is logged (using the Log class).
Currently, the logs (List) are stored in memory (and this is where maybe there is an issue). When the operation is complete (all backups are finished), I want the Logs to be displayed. My backup.cs class creates an instance of the MainWindow
and passes the List<Log>
object as a constructor, and I bind it to the data context. This works fine.
However, I now want to use the MVVM approach since I want to use 2 way binding (I want to filter by log status (success or fail (or other states)).
So, does any one feel this is possible with my current design or is the only way forward to be saving the logs as an XML file (or text or similar) just so my Model can be created (using LinqToXml)? Or is there a different approach?