ShadowMare
ShadowMare

Reputation: 2097

WPF DatePicker Popup Calendar Background Color

How can I style the background color of the popup / dropdown control of the default WPF DatePicker control? I want to do this via xaml.

This does not work:

    <Style TargetType="{x:Type DatePicker}">
        <Setter Property="FontFamily" Value="/fonts/#Titillium Web" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Background" Value="#777777" />
    </Style>

I assume that it does not target the right property.

This is how it currently looks. I want to change the white background to something readable.

expanded DatePicker[1]

Upvotes: 4

Views: 4372

Answers (1)

sschimmel
sschimmel

Reputation: 196

Try targeting DatePickerTextBox, like so:

<Style TargetType="{x:Type DatePickerTextBox}">
  <Setter Property="Background" Value="#777777" />
</Style>

Upvotes: 1

Related Questions