I have large collection of MyFile objects which are linked in all kind of ways between each other like spaghetti. In addition, from this collection I create smaller subcollections of some items that are equal by some criteria. (for example all files with the extension .txt, all files that belong to certain directory etc...)
Basically I have complex structure of linked lists in my business logic. Now I want to create ViewModel for this in order to prepare it for View and this is where I hit the wall. I just can't figure out how to prepare this mess and still keep everything efficient and organized.
First problem is that wrapping each collection in collectionViewModel by enumerating item by item and creating itemViewModel will create duplicate itemViewModel for each item (since one item can be contained in several collections)
Second problem is how to keep everything updated? If for example an item1 in business logic changes its reference from item2 to item3, then ViewModels should update them accordingly.
I am really tempted to break from the MVVM pattern here even though I dont want it, and put bussines + presentation logic in one object/class since this spaghetti structure seems a bit too much for my level of understanding of MVVM.
Thanks