private void Image_Loaded(object sender, RoutedEventArgs e) { if (sender is Image img && img.Source is DrawingImage drawingImage) { img.Source = new DrawingImage { Drawing = ImageThemingUtilities.TransformDrawing(drawingImage.Drawing, IconThemeSelector.KnownThemes.Dark.GetIconTheme()) }; } }
public override object ProvideValue(IServiceProvider serviceProvider) { if (Source is DrawingImage drawingImage) { return(new DrawingImage { Drawing = ImageThemingUtilities.TransformDrawing(drawingImage.Drawing, Theme) }); } else { return(Source); } }
public override object ProvideValue(IServiceProvider serviceProvider) { var image = new Image { Source = source }; if (source is DrawingImage drawingImage) { image.Source = new DrawingImage() { Drawing = ImageThemingUtilities.TransformDrawing((source as DrawingImage)?.Drawing, IconThemeSelector.KnownThemes.Dark.GetIconTheme()) }; } RenderOptions.SetBitmapScalingMode(image, scalingMode); if (width >= 0 && height >= 0) { image.Width = width; image.Height = height; } return image; }
public override object ProvideValue(IServiceProvider serviceProvider) { var image = new Image { Source = source }; if (source is DrawingImage drawingImage) { image.Source = new DrawingImage() { Drawing = ImageThemingUtilities.TransformDrawing((source as DrawingImage)?.Drawing, ThemeController.CurrentTheme.GetThemeBase().GetIconTheme()) }; } RenderOptions.SetBitmapScalingMode(image, scalingMode); if (width >= 0 && height >= 0) { image.Width = width; image.Height = height; } return(image); }