Tuesday, August 12, 2014

Adding listener to MessageBox ok button in Windows Phone

I was updating my phone application and needed to provide a response to a user prompt. This is called adding a listener to the message box. This is easily done by adding the following code block into the location where you will be running the messagebox. This SDK supported messagebox control only supports the OK and Cancel buttons. If you want more control then you will need to use the XNAFramework messagebox which supports more customization. Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBoxResult result = MessageBox.Show("Show next message?", "Question", MessageBoxButton.OKCancel); // code after user click if (result == MessageBoxResult.OK) MessageBox.Show("Yeah"); }); Source: http://stackoverflow.com/questions/21773730/adding-listener-to-messagebox-ok-button-in-windows-phone

No comments:

Post a Comment