title: get button width at auto size width in Wpf
body: <p>Hi I want my button in my C# WPF program to autosize depending on content. This is what I already mentioned. 
  But now I want to know what width the button actually got. 
  I tried <code>button.ActualWidth</code> and <code>button.width</code>. The first returned "0" and the second returned "NaN".</p>
  
  <p>My XAML for the button</p>
  
  <pre><code>&lt;Button x:Name="button1" Content="Button" HorizontalAlignment="Left" Margin="61,41,433,0" VerticalAlignment="Top" IsEnabled="False" Click="button1_Click"/&gt;
  </code></pre>
  
  <p>New content of my button:</p>
  
  <pre><code>button1.Content = "new content xayxax ";
  
  nWidth = button.ActualWidth;
  MessageBox.Show(nWidth.ToString());
  </code></pre>
  
  <p>This Messagebox displays "0"</p>