using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Windows; using System.Windows.Threading; namespace MemoryMatch { /// /// Designates a Windows Presentation Foundation application with added functionalities. /// public class WpfApplication : Application { /// /// Processes all messages currently in the message queue. /// /// /// This method can potentially cause code re-entrancy problem, so use it with great care. /// public static void DoEvents() { Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new ThreadStart(delegate { })); } } }