title: WPF: Textblock Font size should be even when its size change
body: <p>I create a custom button in my application as following</p>
  
  <pre><code>&lt;Button x:Class="MyApp.ButtonMainMenuSubCat"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               mc:Ignorable="d" 
               d:DesignHeight="100" d:DesignWidth="536"&gt;
      &lt;Button.Template&gt;
          &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
              &lt;Grid&gt;
                  &lt;Grid Name="gridParent"&gt;
                      &lt;Image Name="imgTransparent" Source="/MyApp;component/Resources/LeftCategoryTransparent.png" Stretch="Fill" Margin="0,0,0,0"  /&gt;
                      &lt;Image Name="Part_Pressed" Source="/MyApp;component/Resources/PressedMainScreenSubMenu.png" Stretch="Fill" Margin="0,0,0,4"  Visibility="Hidden"/&gt;
                      &lt;Image Name="Focused" Source="/MyApp;component/Resources/MainSubMenuFocus.png" Margin="-3,0,-3,3"   Stretch="Fill" Visibility="Hidden" /&gt;
                      &lt;Image Name="Seperator" Source="/MyApp;component/Resources/MainSubMenuSeperator.png" Margin="5,0,5,-1"   Stretch="Uniform" VerticalAlignment="Bottom"/&gt;
  
                      &lt;TextBlock Name="lblTitle" Text="{TemplateBinding Content}" HorizontalAlignment="Left"  Foreground="Gray" FontWeight="{TemplateBinding FontWeight}"   FontSize="24"  Margin="10" VerticalAlignment="Center" TextWrapping="WrapWithOverflow" TextAlignment="Left"/&gt;
                  &lt;/Grid&gt;
              &lt;/Grid&gt;
              &lt;ControlTemplate.Triggers&gt;
                  &lt;Trigger Property="IsPressed" Value="True"&gt;
                      &lt;!--&lt;Setter TargetName="Pressed" Property="Visibility" Value="Visible"/&gt;--&gt;
  
                  &lt;/Trigger&gt;
                  &lt;Trigger Property="IsFocused" Value="True"&gt;
                      &lt;Setter TargetName="Focused" Property="Visibility" Value="Visible"/&gt;
                      &lt;Setter TargetName="lblTitle" Property="Foreground" Value="#f8cb1c" /&gt;
                  &lt;/Trigger&gt;
              &lt;/ControlTemplate.Triggers&gt;
          &lt;/ControlTemplate&gt;
      &lt;/Button.Template&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>In my application, I call web service and depending upon the no of items, i create button for each item and finally add these button in StackPanel. Its works well. Stakpanel layout is on left side in screenshot. Now problem is that when I run this application on different machine which have different Screen resolution (like 1920 *1200), then font size seems too small. So i want to adjust font size when container size change. One option is use <strong>ViewBox</strong> but in case of ViewBox all buttons seems like have different font size and TextWrapping is not possible. </p>
  
  <p>So my actual requirement is that increase/decrease the textblock's font size with TextWrapping  and font size must be even for all buttons.</p>
  
  <p><img src="https://i.stack.imgur.com/Nkb4d.png" alt="enter image description here"></p>