I'm new to WPF/XAML & I'm just doing a training exercise at the moment.
I've got a noddy application and I want to change the size of the text in a tag based on the position of a scroll bar.
The text is defined by this code:
<FlowDocumentScrollViewer Grid.Row="1">
<FlowDocument>
<Paragraph>
Text goes here
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
I'm trying to define a Setter and I've got as far as this:
<Style TargetType="{x:Type Paragraph}">
<Setter Property="FontSize" Value="???" />
</Style>
But I can't find out what needs to go in place "???". I've tried Googling for the answer to this, but I think I must be using the wrong search terms because I haven't found the answer yet.
I'm guessing that it's going to be really obvious, but I've got to admit I'm stumped.
The value of FontSize is just a number that describes the size (in points I think):
I don't know if this is the answer you want cos it feels really obvious.
You can just set the font size with a binding expression like this:
What you want to look into is the binding expression syntax, because currently intellisense isn't supported there.
The code that I implemented is this:
Which works a treat.