public static void Synchronize(GuiSynchronizeHandler handler, Object data) { if (Application.Current != null && handler != null) { Application.Current.Dispatcher.BeginInvoke( (Action)(() => { handler(data); }) ); } }