I would like to implement a message box in my wpf-project. The text is: "Choose Language:" The alternatives are English (OK) and German (Cancel).
In this context, I am trying to customize the buttons in the MessageBox. For doing this, I try to implement the Extended WPF Toolkit, but I have problems in terms of understanding the documentation for the Extended WPF Toolkit.
My code is like this:
"Xceed.Wpf.Toolkit.MessageBox msgBox = new Xceed.Wpf.Toolkit.MessageBox();
msgBox.OkButtonContent = "English";
msgBox.CancelButtonContent = "German";
MessageBoxResult result =msgBox.ShowMessageBox("Choose Language: ", "Language",MessageBoxButton.OKCancel);"
Questions:
1) Are the any other suitable controls to use where the user of the wpf application can choose among alternatives?
2) Where do I find some nice example/documentation for customizing button labels in a message box?
Just in code solution:
System.Windows.Style style = new System.Windows.Style();
style.Setters.Add(new Setter(Xceed.Wpf.Toolkit.MessageBox.YesButtonContentProperty, "Yes, FTW!"));
style.Setters.Add(new Setter(Xceed.Wpf.Toolkit.MessageBox.NoButtonContentProperty, "Omg, no"));
MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show("My text", "My caption", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.Yes, style);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With