Search code examples
windows-8timermessageboxupdatingmessagedialog

Windows 8 MessageDialog, dynamically update content


There is one MessageDialog with text, that must be updated on timer (DispatcherTimer). Debugger shows, that on timer tick Content property is assigned, but visually there are no changes. Is there any tricky way to display new title?


Solution

  • MessageDialog blocks the UI thread until it's closed. So, you cannot change anything on the UI until it's closed. The only you can update it you need to call ShowAsync() method periodically in the tick event of the DispatchTimer. However, before closing the old message dialog, it won't work. Best way to achieve this, uou should implement your own message dialog as a user control.