Refresh/Reset View

Posted by Jay on Stack Overflow See other posts from Stack Overflow or by Jay
Published on 2010-03-23T10:08:36Z Indexed on 2010/03/23 10:13 UTC
Read the original article Hit count: 410

Filed under:
|
|
|

Hi, I'm using MVP in WPF and I came across a design doubt and I would to get your opinion on this:

At some point I need to refresh my view and perform the same initial queries, like when the view was loading. The view's DataContext is my presenter and I have a couple of collections and other variables that are bound to the view. When I need to refresh the view, I'm clearing the collections and the variables and setting the DataContext to null. After that I fetch new data, populate the collections and set the DataContext. Is this the best way to achieve this?

The issue with this, is that i'm affraid that when my app grows bigger I forget to reset some variable...the ideal would be to reload the view again in some way without having to worry with the variables I have.

Best regards.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about mvp