// Show a warning
MessageBoxResult result = MessageBox.Show("Strobe lights can trigger " +
"seizures for people with photosensitive epilepsy. " +
"Are you sure you want to start the strobe light?",
"Warning!", MessageBoxButton.OKCancel);
// If the user agreed, change to strobe mode
if (result == MessageBoxResult.OK)
{
// Change the button icon, the mode, and start the timer
(sender as IApplicationBarIconButton).IconUri =
new Uri("Images/cancel.png", UriKind.Relative);
this.mode = FlashlightMode.Strobe;
this.strobeTimer.Start();
}