title: WPF DatePicker does not use Material Design's style
body: <p>I am using MaterialDesignThemes in my WPF project and I am able to see MaterialDesign styles being used by various WPF controls I am using. In one particular situation, however, I'm having a great bit of difficulty trying to get a DatePicker to use the MaterialDesign styling. When I render DatePickers in a XAML view, it works as expected. The difference is that in the case that it does not work, the date picker is rendered in code behind. Below is my code. Can anyone help? </p>
  
  <pre><code>var dp = new DateControl()
  {
       Margin = new Thickness(0, 0, _fontSize, 0),
       HorizontalAlignment = HorizontalAlignment.Left,
       Question = q,
       IsReadOnly = IsReadOnly || q.IsReadOnly
  };
  if (dataValue != null)
  {
       DateTime dt = DateTime.MinValue;
       if (DateTime.TryParse(dataValue, out dt) &amp;&amp; dt &gt; DateTime.MinValue)
       {
             dp.SetSelectedDate((DateTime?)dt);
      }
      else
      {
           dp.Text = dataValue;
      }
  }
  if (!IsReadOnly)
      dp.AddHandler(DateControl.LostFocusEvent, new RoutedEventHandler(HandleUserResponse));
  
  MaterialDesignThemes.Wpf.ColorZoneAssist.SetMode(dp, ColorZoneMode.PrimaryDark);
  
  return dp;
  </code></pre>