Lets say I have a scenario in which I'm wanting to display a business object that is built up of many other business objects, i.e it is deeply hierarchical.
To display the data I would want to use a masterDetail type of view but with many many levels letting me dig deeper and deeper into the data.
So I'll want to select an item from some list at the root of the object, and show its detail view of properties, then select an item from that detail view and show its detail view etc etc.
If I wasn't interacting with the data, then I wouldn't need to create viewModels for each Model within the deep hierarchy, as I could just bind straight to the Model.
If I was interacting with the data, then I might want to wrap the entire business object and its descendants with view models, and bind to that, allowing me to add commands to perform certain logic.
But what if I only want to interact with data at certain levels? trying to interact with the model directly from XAML or codeBehind would be messy. Yet wrapping the whole thing with ViewModels is a lot of work.
Im thinking that I would just use converters to create viewModels at specific points
<DisplayControl DataContext="{Binding A}">
<DisplayControl DataContext="{Binding B}">
<InteractionControl DataContext="{Binding C, Converter{ConvertModelToViewModel}}">
</InteractionControl >
</DisplayControl >
</DisplayControl >
but what if I then need to perform cleanup on those Viewmodels? such as unregistering from events. Every time I go back and forth to the same item it will create new viewmodels for the same Model. I dont want to rely on garbage collection as keeping the viewmodels around could be expensive depending on what they're doing, and GC might not even occur (such as if Im registering to events of static classes). Using weak events would help with GC, but it still wont help in the case of keeping around expensive viewModels longer than they need to.