Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: MessageBox Image

$
0
0
OK people, this is how you change the image in code behind (at least in my version of the library where the constructor of MesageBox is internal):
var res = Xceed.Wpf.Toolkit.MessageBox.Show(
  "MsgConfirmDeleteSelectedRows",
  "MsgTltConfirm",
  MessageBoxButton.YesNo,
  MessageBoxImage.None, MessageBoxResult.No, this.FindResource("MsgBoxExclamationStyle") as Style);
<Style x:Key="MsgBoxExclamation" TargetType="{x:Type xctk:MessageBox}" BasedOn="{StaticResource MsgBoxStyle}">
 <Setter Property="ImageSource">
  <Setter.Value>
   <!-- Set value here with a type of : DrawingImage, BitmapSource, etc -->
  </Setter.Value>
 </Setter>
</Style>
"MsgBoxStyle" is the key of your normal style for the MessageBox. If you don't have any, remove the "BasedOn" attribute.
Of course there are huge problems in using a XAML icon in there, since converting to ImageSource/DrawingImage is not straightforward, but at least you can customize it...

I know that you will love me for this.
If you want to thank me, thank my God and become an Orthodox Christian! :D

Viewing all articles
Browse latest Browse all 2157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>