I am writing my first WPF application and I have a scenario where I want to use tab controls to handle views that allow the user to work with more than one "widget" at a time. I am still just prototyping with the databinding after changing my EF classes to ObservableCollection, and it's fun stuff, but at the same time if I am to use say the entity represented by a datagrid row to set the context for a view, if the user makes changes to that data it will mark it as such in the DbContext change tracker. If they make partial changes in one tab, switch to another and attempt to save changes, it would save all changes across all tabs which may not be their intention.
I am just looking into MVVM but to be honest with so much to absorb with the binding, properties, and commands I haven't seen whether MVVM would address an issue like this. I thought of passing in a primary key to the view and have it construct a new datacontext
so changes are isolated to that one view but then I am giving up the performance benefits of having the entities in the datagrid ready for instant binding as well as incurring (probably negligible) hits by having multiple DbContexts.
Any help or suggestion is appreciated. If there is something I should read that is directly relevant to this I'd be happy to. Thanks!