I've been tinkering around with the MVVM pattern and now I'm trying to implement a little application based on it.
This application has a datagrid in which, surprisingly enough, some data is presented. Now I'm trying to add some grouping ability to it. I know how to write this in code (C# and XAML), but I'm wondering in what layer I should put the responsible code.
One part of me tells me it should be in the view, because it's code especially for that specific view. It's not generic and serves one purpos: to group the data.
On the other hand I think I should handle it in the ViewModel using a command. It feels, though, as if I'm contaminating my ViewModel with View specific logic.
Any ligt that can be shed on this?
In most of my MVVM apps I try to divide responsibilities like this:
So I think grouping should go in the viewmodel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With