示例#1
0
 public static void UpdateBookAuthorCollection(DispatcherObject dob, GlobalDataObject gdo)
 {
     dob.InvokeIfRequired(() =>
     {
         gdo.UpdateBookAuthorCollection();
     }, DispatcherPriority.Render);
 }
示例#2
0
        /// <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);
        }