Hi all
i am using WindowsFormsHost web browser in my wpf application. in browser i implemented refresh and stop methods now i want if i click on refresh button while refreshing the stop button should visible and after completing refresh page stop button should disappear automatically same as google chrome.
i collapsed the visibility of both controls on click event but im not getting proper solution for this.
plz help thanx
Darshan UnadkatPosted Jul 11, 2012, 8:03 AM
You could try backgroundworker approach. I mean to say when you press Refresh at that time you should call the backgroundworker which will fetch all the data which you wish to update, Meanwhile if users wants to cancel the refresh he can press the cancel and you can stop the background worker and flush all the objects created.
Once the refreshing of the backgroundworker is completed you will need to rebind the controls, during this period the screen will freeze for some time as it will rebind the data and refresh the control layout.
Please view bellow link for more details on Backgroundworker:
http://elegantcode.com/2009/07/03/wpf-multithreading-using-the-backgroundworker-and-reporting-the-progress-to-the-ui/
Regards,
Darshan Unadkat.