public static BitmapImage GetImage(MessageDialogImage image, MessageDialogImageColor color) #endif { if (image == MessageDialogImage.None) { return(null); } string packuri = "/SolidShineUi;component/DialogImages/"; BitmapImage img; try { img = new BitmapImage(new Uri(packuri + image.ToString("f") + color.ToString("f") + ".png", UriKind.Relative)); } catch (IOException ex) { throw new ArgumentException("Cannot find an icon with this name.", nameof(image), ex); } return(img); }
/// <summary> /// Return a 32x32 image to use with a message dialog. If the MessageDialogImage argument is "None", then <c>null</c> is returned. /// </summary> /// <param name="image">The image to display. If "None", then <c>null</c> is returned.</param> /// <param name="color">The color to use for the image. Use black or white for high-contrast themes.</param> /// <returns></returns> #if NETCOREAPP public static BitmapImage?GetImage(MessageDialogImage image, MessageDialogImageColor color)