title: How to apply calendar style in WPF?
body: <p>I'm trying to apply calendar style , but it not applying .</p>
  
  <pre><code>&lt;DatePicker Grid.Column="1" Margin="5" Background="Transparent"
              CalendarStyle="{StaticResource CalenderStyle1}"/&gt;
  </code></pre>
  
  <p>Style </p>
  
  <pre><code>&lt;Style x:Key="CalenderStyle1" TargetType="{x:Type Calendar}"&gt;
      &lt;Setter Property="Foreground" Value="Red"/&gt;
      &lt;Setter Property="Background" Value="White"/&gt;
  
      &lt;Setter Property="BorderBrush"&gt;
          &lt;Setter.Value&gt;
              &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                  &lt;GradientStop Color="#FFA3AEB9" Offset="0"/&gt;
                  &lt;GradientStop Color="#FF8399A9" Offset="0.375"/&gt;
                  &lt;GradientStop Color="#FF718597" Offset="0.375"/&gt;
                  &lt;GradientStop Color="#FF617584" Offset="1"/&gt;
              &lt;/LinearGradientBrush&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
      &lt;Setter Property="BorderThickness" Value="1"/&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type Calendar}"&gt;
                  &lt;StackPanel x:Name="PART_Root" HorizontalAlignment="Center"&gt;
                      &lt;CalendarItem x:Name="PART_CalendarItem" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Style="{StaticResource CalendarItemStyle1}"/&gt;
                  &lt;/StackPanel&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Style was applied with UI . Is there any mistake in my code ? Why style was not applying ?</p>