lundi 4 janvier 2016

load and reload data in wpf app - best practice wpf

I've just completed my first wpf app but I run into the issue of loading a recent project without closing the whole app first.

I'm using sqlLite to retrieve data from and load as resources in my app. The ViewModels use the appropriate resource and turn it into observablecollections or Lists or ListCollectionView.

The ViewModels are Binded to Views that are UserControls inside a Window.

Now I want to Load a new file, which is data that comes from tables inside an sqlLite database. Do I need to close the usercontrols first, or remove the resources and any of the collections (clear memory) before loading the new data?

What is the best approach and how do I remove the Resources. Is there a fast way or do I need to clear all the individual collections first before creating new Resources.

I'm new to this, so I'd like to know what's .best practice. in this case?

Aucun commentaire:

Enregistrer un commentaire