public static void UpdateBookAuthorCollection(DispatcherObject dob, GlobalDataObject gdo) { dob.InvokeIfRequired(() => { gdo.UpdateBookAuthorCollection(); }, DispatcherPriority.Render); }
/// <summary> /// Simple helper extension method to marshall to correct thread if its required. /// </summary> /// <param name="control">The source control.</param> /// <param name="methodcall">The method to call.</param> public static void InvokeIfRequired(this DispatcherObject control, Action methodcall) { #if DOTNET4 Contract.Requires(control != null); Contract.Requires(methodcall != null); #endif control.InvokeIfRequired(methodcall, DispatcherPriority.Normal); }