EldoS | Feel safer!

Software components for data protection, secure storage and transfer

conflict between Unmount and System.Windows.Application.Current.Dispat

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#21568
Posted: 09/17/2012 08:51:39
by ttran Tran (Priority Standard support level)
Joined: 08/20/2012
Posts: 35

Hello,
In CBFS part, inside CbFsCloseFile we have a code to update GUI as following:

Code
System.Windows.Application.Current.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (System.Threading.ThreadStart)delegate
            {

                Code for update GUI



            });

OK, whenever we invoke myCbFs.unmount() during the uploading files process (it means CbFsCloseFile occurs), we discover that the application is always freezing at the GUI Thread above. Is that true that Unmount also access screen ?
What is the safe strategy to get rid of this freezing situation ?

Thanks
Tran
#21570
Posted: 09/17/2012 09:17:11
by Eugene Mayevski (EldoS Corp.)

You should not do any UI operations in callback. The general rule is the less you do in callbacks, the better. You need to post an asynchronous notification to another thread (including main thread) which would handle the notification and update the UI.


Sincerely yours
Eugene Mayevski
#21600
Posted: 09/18/2012 13:16:19
by ttran Tran (Priority Standard support level)
Joined: 08/20/2012
Posts: 35

Thanks - valuable advice

Reply

Statistics

Topic viewed 1023 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!