Image control that get's greyed out when disabled. This control is intended to be used for toolbar, menu or button icons where ability of an icon to grey itself out when disabled is essential. Подробнее...
Защищенные члены | |
override void | OnPropertyChanged (DependencyPropertyChangedEventArgs e) |
Overwritten to handle changes of IsEnabled, Source and OpacityMask properties. |
Image control that get's greyed out when disabled. This control is intended to be used for toolbar, menu or button icons where ability of an icon to grey itself out when disabled is essential.
1) Greyscale image is created using FormatConvertedBitmap class. Unfortunately when converting the image to greyscale this class does n0t preserve transparency information. To overcome that, there is an opacity mask created from original image that is applied to greyscale image in order to preserve transparency information. Because of that if an OpacityMask is applied to original image that mask has to be combined with that special opacity mask of greyscale image in order to make a proper greyscale image look. If you know how to combine two opacity masks please let me know. 2) DrawingImage source is not supported at the moment. 3) Have not tried to use any BitmapSource derived sources accept for BitmapImage so it may not be able to convert some of them to greyscale. 4) When specifying source Uri from XAML try to use Absolute Uri otherwise the greyscale image may not be created in some scenarious. There is some code to improve the situation but I cannot guarantee it will work in all possible scenarious. 5) In case the greyscaled version cannot be created for whatever reason the original image with 60% opacity (i.e. dull colours) will be used instead (that will work even with the DrawingImage source).
override void AvalonDock.GreyableImage.OnPropertyChanged | ( | DependencyPropertyChangedEventArgs | e | ) | [protected] |
Overwritten to handle changes of IsEnabled, Source and OpacityMask properties.
e |