Possible Duplicate:
WPF 4: Grow/Shrink TextBlock (Font Size) based on available space
I ma looking for a following behaviours in WPF: All the TextBlock in my app are shown in the 24 Font size, but if there isn't enough space I would to decrease a font size.
I thought of two solutions, but none of them work:
- Put a textBox inside viewbox. Doesn't work, as all labels start to get different sizes.
- If that would be a button I would specify a MinWidth instead of Width, but there is no property called MinFontSize on the TextBlock. Edit:
- Create a custom control with property MinTextWidth (this might work)
Any other solutions, which would work?