WPF automatic resize font until it fits within parent control WPF automatic resize font until it fits within parent control wpf wpf

WPF automatic resize font until it fits within parent control


Wrapping your ContentControl in a Viewbox set to only scale down will do this for you:

<Viewbox StretchDirection="DownOnly" Stretch="Uniform">    <ContentControl Content="Some Text"/></Viewbox>