title: Custom DateTime stringformat in WPF
body: <p>I can't get my custom DateTime string format to work in my binding.  I want the format to be "mmmm, yyyy" (e.g. "June, 2012").</p>
  
  <p>The following does not work.  I get a short date format (m/d/yyyy).</p>
  
  <pre><code>&lt;TextBlock Text="{Binding ElementName=ThisWindow,
                            Path=Date,
                            StringFormat={}{0:MMMM\, yyyy}"/&gt;
  </code></pre>
  
  <p>I've considered using a converter, but I prefer a pure XAML approach.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>For clarity, I have a <code>Window</code> with a dependency property <code>Date</code> of type <code>DateTime</code>.  In my XAML, I've named the window 'Thiswindow'.</p>
  
  <p><strong>Edit 2:</strong></p>
  
  <p>I looked back at my actual code, and I had a <code>Label</code>, not a <code>TextBlock</code>.  I changed it to TextBlock and it works fine.</p>
  
  <pre><code>&lt;Label Content="{Binding ElementName=ThisWindow,
                   Path=Date,
                   StringFormat={}{0:MMMM\, yyyy}"/&gt;
  </code></pre>
  
  <p>Anyone know why it doesn't work with <code>Label</code>?</p>
  
  <p>Thanks.</p>