I was wondering what is the best approach for a Data visualisation application for WPF and MVVM The key points are:
- The data is loaded, or needs just a little preparation such as pulling out particular set of data from the underlying structure.
- The library for the data visualisation in WPF can change in the future, basically it is undecided at this point and will may change due to licensing requirements etc. So some sort or common abstraction will need to be created and custom converter, adaptors will need to be implemented.
- Ideally MVVM pattern should be followed
My questions are:
If View-Model should not be concerned with View where should the implementation specific logic for the view be contained, in the code-behind? But what if I decide to change the GUI, but want to keep the same data-visualization library or vice-versa?
I think it is fairly clear that my common abstraction should be written in View-Model. But there are still some unclear issues such as the common idea that nothing concerned with View could be in the View-Model. But what if the whole purpose of the application is viewing of the data? I often find it confusing, as some people say that the View-Model is for logic for the View, others that it is for the application logic only. I in the past for example needed to implement DataGrid filtering in my ViewModel, due to the lack of better place, but still find it somehow not entirely clear whether it is View concern or app-logic concern, because the format of the methods is determined by what DataGrid filtering mechanism in WPF require, but the actual logic can be re-used.