The TextBlock.FontSize
must be the product of
- a dynamic resource
FontSizeFactor
- a static hard-coded value
32
How can I do this in XAML?
(With Binding, MultiBinding, Converter or whatever, but without code behind)
The TextBlock.FontSize
must be the product of
FontSizeFactor
32
How can I do this in XAML?
(With Binding, MultiBinding, Converter or whatever, but without code behind)
Try this Math Converter You can do a lot of calculations in xaml by using this ValueConverter
Check whether the below solution meets your requirement. Note: The solution works for staticResource. Inside the convertor you can product the FontSizeFactor value and 32
<Window.Resources>
<Clr:String x:Key="FontSizeFactor">2</Clr:String>
<local:MyConverter x:Key="MyConverter" />
</Window.Resources>
<Canvas>
<TextBlock Text="siva" FontSize="{Binding Converter={StaticResource MyConverter},
ConverterParameter={StaticResource FontSizeFactor}}" />
</Canvas>