ThemedMessageBox
The ThemedMessageBox is a dialog that replaces the default MessageBox using the current theme.
Show(string message, string title, MessageBoxButton button)
Shows a modal dialog using the current theme. Returns a MessageBoxResult that represents the choice of the user.
Arguments
stringmessage : The message to displaystringtitle : The title of the dialogMessageBoxButtonbutton : The buttons to display
Example
MessageBoxResult quest = ThemedMessageBox.Show("Do you want to save changes?", "Save changes", MessageBoxButton.YesNoCancel);
switch (quest)
{
case MessageBoxResult.Yes:
// Yes button was clicked
break;
case MessageBoxResult.No:
// No button was clicked
break;
case MessageBoxResult.Cancel:
// Cancel button was clicked
break;
}
Show(string message, string title, MessageBoxButton button, string defaultButtonText, string secondaryButtonText)
Shows a modal dialog using the current theme. Returns a MessageBoxResult that represents the choice of the user.
This method can be used to override the default texts and provide a better UX while still using the default framework components.
This method should be used with the MessageBoxButton.YesNoCancel or MessageBoxButton.YesNo arguments. The Yes button will be replaced with the defaultButtonText value, and the No button will be replaced with the secondaryButtonText.
Arguments
stringmessage : The message to displaystringtitle : The title of the dialogMessageBoxButton: The buttons to displaystringdefaultButtonText : The text to display in the default button (the Yes button when usingMessageBoxButton.YesNoCancelorMessageBoxButton.YesNo)stringsecondaryButtonText : The text to in the the secondary button (the No button when usingMessageBoxButton.YesNoCancelorMessageBoxButton.YesNo)
MessageBoxResult Show(string message, string title, Window owner, MessageBoxButton button, string? defaultButtonText = null, string? secondaryButtonText = null)
Shows a modal dialog using the current theme. Returns a MessageBoxResult that represents the choice of the user.
This method can be used to override the default texts and provide a better UX while still using the default framework components.
This method should be used with the MessageBoxButton.YesNoCancel or MessageBoxButton.YesNo arguments. The Yes button will be replaced with the defaultButtonText value, and the No button will be replaced with the secondaryButtonText.
Arguments
stringmessage : The message to displayWindowowner: The Window that will own the dialogstringtitle : The title of the dialogMessageBoxButton: The buttons to displaystringdefaultButtonText : The text to display in the default button (the Yes button when usingMessageBoxButton.YesNoCancelorMessageBoxButton.YesNo)stringsecondaryButtonText : The text to in the the secondary button (the No button when usingMessageBoxButton.YesNoCancelorMessageBoxButton.YesNo)