I am trying to use message dialog in dispatch timer to alter user when the time is complete. but at times it gives following error: \"Access is denied. (Exception from HRESU
The dispatcherTimer_Tick method is running on a different thread than the UI. If you want to access stuff that is bound to the UI thread, like UX, you must get back onto the UI thread. Easiest way to do this is wrap your code with