I have the following xaml in a template for a lookless control:
<Style x:Key="NumericUpDownStyle" TargetType="controls:NumericUpDown">
<Style.Setters>
<Setter Property="Change" Value="{x:Static local:Preferences.ChangeAmount}"/>
</Style.Setters>
</Style>
Where the 'Change' property on the 'NumericUpDown' control is a decimal, and the static 'Preferences.ChangeAmount' is a float.
This fails with the following error:
'1' is not a valid value for property 'Change'
Is there a way to get the style to cast the float to a decimal? It is not an option to change the 'NumericUpDown' control, the underlying control that I am templating, or the 'Preferences.ChangeAmount' property. I can make some static wrapper properties somewhere to do the casting but that seems silly to me.
Any ideas?