I am building a button style that relies on converting a colour brush to a darker shade to create a shadow. In regular XAML I have a converter than I use on the binding that works perfectly:
BorderBrush="{Binding Background, Converter={StaticResource ColourBrushToDarker}}"
But I can't get the converter to work with TemplateBinding in a style definition. Is there a way? Visual Studio just doesn't allow a converter on a TemplateBinding.
I've tried the following with no luck:
Background="{Binding Converter={StaticResource ColourBrushToDarker}, ConverterParameter={Binding Path=Background}}"/>
(And I've tried the above line with TemplateBinding replacing Binding as well as several other iterations)
Can this be done? The other thing I thought of was coding a property in C# that does the conversion, but a style doesn't have a code behind file.
The result I'm after is to be able to create a new brush that is a shade darker than the Background property so the button always has a shadow that is a bit darker than its main background colour.