WPF: Is it possible to use a converter within a style? For instance I am trying to create a styled TextBlock whose text resizes based on the ActualHeight property of the TextBlock. The resizing would be don via converter...
+5
A:
Yes, this is possible. For example:
<Style TargetType="TextBlock">
<Setter Property="FontSize">
<Setter.Value>
<Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}">
<Binding.Converter>
<MyConverter/>
</Binding.Converter>
</Binding>
</Setter.Value>
</Setter>
</Style>
HTH, Kent
Kent Boogaart
2008-12-18 19:58:12
Thanks - this worked perfectly!
2008-12-18 22:54:17