What approach(es)/design(s) I should use/consider to update like User Control Types (E.g. DataGrid/TextBox/etc) periodically from DB in WPF with MVVM pattern?

I am able to get data from the database and present it into like Comboboxes\DataGrid(s)\etc. on view (using obseravlecollection and propertychange) in WPF. However, I noticed that if changes were done to database (E.g. through applications like SSMS, etc.), User Control Types won't reflect the change (if it's update or delete).

So, I was thinking utilizing polling but I am not sure the best approach (things to be aware of when designing like RefreshContentService class) to do this? What would you recommend?

I am also thinking of making this bit different where user starts to make any changes, for instance datagrid (add new row or edit row contents), it would pause the refresh until the user finishes the task then it will proceed with refresh. Also, if a view was designed and there are parts which contains a lot of observable collections, when would it be best time to use like targeted refresh (like just datagrid/textbox) over the whole view page (refreshing whole observable collections). Would it also be beneficial to use like lock in the refresh method(s)?

NeoGenesis521's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.