CarlosTI
CarlosTI

Reputation: 133

Change foreground property of CalendarGlyph in CalendarDatePicker

I need to change, in UWP, the color of Segoe MDL2 Assets font inside of CalendarDatePicker, to make it looks like this (blue icon):

enter image description here

I've looked in the Dinamic Tree of my app, and I believe I need to change "Foreground" property of CalendarGlyph in CalendarDatePicker:

enter image description here enter image description here

I know how apply styles to CalendarDatePicker, but I don't know how apply styles to specific elements inside of CalendarDatePicker.

Upvotes: 2

Views: 234

Answers (1)

Decade Moon
Decade Moon

Reputation: 34286

You need to override the CalendarDatePickerCalendarGlyphForeground SolidColorBrush resource:

<CalendarDatePicker>
    <CalendarDatePicker.Resources>
        <SolidColorBrush x:Key="CalendarDatePickerCalendarGlyphForeground" Color="CornflowerBlue"/>
    </CalendarDatePicker.Resources>
</CalendarDatePicker>

To apply this to all calendar date pickers, scope the resource appropriately (e.g. put it in the Application.Resources resource dictionary in App.xaml.cs for it to apply app-wide).

Screenshot

Upvotes: 4

Related Questions