This project has moved and is read-only. For the latest updates, please go here.
2
Vote

WindowControl Generic Theme does not work in multiple UI threads

description

The generic theme for WindowsControl will throw an exception if it is used in multiple UI threads in the same application. The cause is two SolidColorBrushes that cannot be frozen due to it deriving its Color coming from a Binding:
            <SolidColorBrush x:Key="Window_WindowBackground" 
                Color="{Binding 
                    Source={x:Static media:WindowColors.ColorizationColor}, 
                    Converter={StaticResource Window_WindowBackground_converter}}" 
                Opacity="0.85"/>

            <SolidColorBrush x:Key="Window_WindowInactiveBackground" 
                Color="{Binding 
                    Source={x:Static media:WindowColors.ColorizationColor}, 
                    Converter={StaticResource Window_WindowInactiveBackground_converter}}" 
                Opacity="0.85"/>
A potential fix for this is to create a custom MarkupExtension that encapsulates the ColorBlendConverter logic and takes as arguments BlendedColor, BlendedColorRatio, and WindowsColor.ColorizationColor. This will allow the brush to be frozen and used by multiple UI threads. The Aero2 theme does not have this problem.

comments