I am working on a project of my company in which they used Dispatcher.Invoke()
in many places.If I am using BeginInvoke
instead of Invoke then the Synchronisation
between threads working fine but in case of Invoke the application is freezing and even not entering the execution to the delegate method also. Does anybody have any idea why it is happening like this?
Any answer will be appreciated.
Sample Code for Invoke
used in the Project:
Dispatcher.Invoke(DispatcherPriority.Send,
new DelegateMethod(MethodtoExecute));
private delegate void DelegateMethod();
void MethodtoExecute()
{
try
{
}
catch (Exception /*ex*/)
{
}
finally
{
}
}