title: WPF: How to bind current date to TextBlock?
body: <p>I am creating my own calendar month view control. I have just started and I have the back and forward button (to browse months) and a text block to show the current month. </p>
  
  <pre><code>&lt;UserControl
      x:Class="MonthView.Controls.MonthViewControl"
      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="300" 
      d:DesignWidth="450"&gt;
    &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
        &lt;RowDefinition Height="50" /&gt;
        &lt;RowDefinition Height="20"/&gt;
        &lt;RowDefinition /&gt;
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;StackPanel 
          Grid.Row="0" 
          Orientation="Horizontal" 
          Margin="20,0" 
          HorizontalAlignment="Left" 
          VerticalAlignment="Center"&gt;
        &lt;Button 
            Name="BackMonthButton" 
            Width="30" 
            Height="23" 
            Margin="0,0,7,0" 
            FontFamily="Arial" 
            FontSize="14" 
            Content="◄" /&gt;
        &lt;Button 
            Name="ForwardMonthButton" 
            Width="30" 
            Height="23" 
            Margin="7,0,20,0" 
            FontFamily="Arial" 
            FontSize="14" 
            Content="►" /&gt;
        &lt;TextBlock 
            Name="DateTextBlock" 
            HorizontalAlignment="Center" 
            VerticalAlignment="Center" 
            FontFamily="Gulim" 
            FontSize="26" 
            Text="March 2011" /&gt;
      &lt;/StackPanel&gt;
  
    &lt;/Grid&gt;
  
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>I am already stuck as I've never created controls in WPF before. I would like the <code>DateTextBlock</code> to display the current month and year. I know I am supposed to bind the <code>Text</code> property to something, but I don't know what. Also, when I click the <code>BackMonthButton</code> or <code>ForwardMonthButton</code>, I would like the <code>DateTextBlock</code> to show the appropriate month and year. Can you help me? Thanks. </p>