title: DatePicker SelectionChanged Code is not working - WPF
body: <p>Here is my code in WPF:
  XAML:</p>
  
  <pre><code>&lt;StackPanel Width="150"&gt;
      &lt;DatePicker Name="dpick" FirstDayOfWeek="Monday" SelectedDateFormat="Short"/&gt;
      &lt;TextBlock Name="dpText"/&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p>C# Code:</p>
  
  <pre><code>public void dpick_SelectionChanged(object sender, EventArgs e)
  {
      dpText.Text = dpick.SelectedDate.Value.Year.ToString() + "-" +
              dpick.SelectedDate.Value.Month.ToString() + "-" +
              dpick.SelectedDate.Value.Day.ToString();
  }
  </code></pre>
  
  <p>dpText.Text is not updated after making a change in date.
  Why this is happening.
  I have tried with ValueChanged event also.Still no update is happening.</p>