Currently for ASP.Net stuff I use a request model where a context is created per request (Only when needed) and is disposed of at the end of that request. I've found this to be a good balance between not having to do the old Using per query model and not having a context around forever. Now the problem is that in WPF, I don't know of anything that could be used like the request model. Right now it looks like its to keep the same context forever (Which can be a nightmare) or go back to the annoying Using per query model that is a huge pain. I haven't seen a good answer on this yet.
My first thought was to have an Open and Close (Or whatever name) situation where the top level method being called (Say an event handling method like Something_Click) would "open" the context and "close" it at the end. Since I don't have anything on the UI project aware of the context (All queries are contained in methods on partial classes that "extend" the generated entity classes effectively creating a pseudo layer between the entities and the UI), this seems like it would make the entity layer dependent on the UI layer.
Really at a loss since I'm not hugely familiar with state programming.
Addition:
I've read up on using threads, but the problem I have with a context just sitting around is error and recovery.
Say I have a form that updates user information and there's an error. The user form will now display the changes to the user object in the context which is good since it makes a better user experience not to have to retype all the changes.
Now what if the user decides to go to another form. Those changes are still in the context. At this point I'm stuck with either an incorrect User object in the context or I have to get the UI to tell the Context to reset that user. I suppose that's not horrible (A reload method on the user class?) but I don't know if that really solves the issue.