I’m moving my windows application to windows8 metro style app, I don’t know how to invoke a method in windows8 metrostyle app, My windows app Code is,
private void appendLog(string msg)
{
if (this.InvokeRequired)
this.Invoke(new MethodInvoker(delegate { this.appendLog(msg); }));
}
Can anyone say me!
Thanks in Advance!
I don’t know exactly what you are trying to accomplish but if it is something like this you should try
Call code directly if called in UI thread, send it to UI thread otherwise:
If the method is called in UI thread the code is called directly, otherwise it is pushed to the dispatcher to be called in UI thread later…
Note: The method
AppendLoghas to be declared in a control. Only this way theDispatcherproperty is available…