title: How to adjust a custom button height when text is wrapped
body: <p>I have a custom button control used in my application, and the textwrapping on everyone is set to wrap for translation purposes. When testing, I found that some strings in various languages wrap according to my specifications, although the button height stays the same, and therefore the second line of text is cut off from view. Now I set each button style in xaml from a custom button style in my ResourceDictionary, but I cannot figure out how to adjust the button height accordingly from the ResourceDictionary (in which case I would only have to change the button style once, instead of manually on every single button which I can do). How would I go about updating by custom button style in my resource dictionary so that the height automatically adjusts accordingly to when the text is wrapped? An example of the button implementation is as follows:</p>
  
  <p>MainPage.xaml</p>
  
  <pre><code>&lt;Button x:Name="btnUseEmailAddress" Style="{StaticResource GlassButton}" Click="btnUseEmailAddress_Click" Margin="0,10"&gt;
                          &lt;Button.Content&gt;
                              &lt;TextBlock TextWrapping="Wrap" Text="{Binding Path=LocalizedResources.MainPage_Contacts_UseContactsEmailAddress, Source={StaticResource LocalizedStrings}}"/&gt;
                          &lt;/Button.Content&gt;
   &lt;/Button&gt;
  </code></pre>
  
  <p>ResourceDictionary.xaml</p>
  
  <pre><code>&lt;Style x:Key="GlassButton" TargetType="Button"&gt;
      &lt;Setter Property="FontSize" Value="25.33" /&gt;
      &lt;Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" /&gt;
      &lt;Setter Property="Height" Value="60"/&gt;
      &lt;Setter Property="Padding" Value="10,3,10,5"/&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="Button"&gt;
                  &lt;Border x:Name="ButtonBorder" 
                CornerRadius="30" 
                BorderThickness="4,4,4,4" 
                Background="#AA000000"  
                BorderBrush="#99FFFFFF"
                RenderTransformOrigin="0.5,0.5"&gt;
                      &lt;Grid&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition Height="*"/&gt;
                              &lt;RowDefinition Height="1.7*"/&gt;
                          &lt;/Grid.RowDefinitions&gt;
                          &lt;Border Grid.Row="0" CornerRadius="23,23,0,0"&gt;
                              &lt;Border.Background&gt;
                                  &lt;LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"&gt;
                                      &lt;GradientStop Color="#08FFFFFF" Offset="0"/&gt;
                                      &lt;GradientStop Color="#88FFFFFF" Offset="1"/&gt;
                                  &lt;/LinearGradientBrush&gt;
                              &lt;/Border.Background&gt;
                          &lt;/Border&gt;
                          &lt;ContentPresenter x:Name="ButtonContentPresenter"
                              VerticalAlignment="Center"  
                              Grid.RowSpan="2" 
                              HorizontalAlignment="Center"/&gt;
                      &lt;/Grid&gt;
                  &lt;/Border&gt;
                  &lt;!--&lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsPressed" Value="True"&gt;
                          &lt;Setter Property="RenderTransform" TargetName="ButtonBorder"&gt;
                              &lt;Setter.Value&gt;
                                  &lt;TransformGroup&gt;
                                      &lt;ScaleTransform ScaleX="0.9" ScaleY="0.9"/&gt;
                                  &lt;/TransformGroup&gt;
                              &lt;/Setter.Value&gt;
                          &lt;/Setter&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;--&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>To note, the Glass button style as of currently looks great and is exactly what I want, except for when the text is wrapped. I can adjust the button height to auto in the MainPage.xaml using <code>&lt;Button x:Name="btnUseEmailAddress" Height="Auto"...</code> but I would have to do this for every single button (which is a lot!). So is there any way to accomplish this in the glass button style?</p>