Skip to content
Discussion options

You must be logged in to vote

The DateTimePicker uses internally the Calendar control and it's possible to change these styles from outside. Setting the day foreground is a little bit tricky because of limitations to the WPF control itself.

<mah:DateTimePicker>
    <mah:DateTimePicker.CalendarStyle>
        <Style TargetType="{x:Type Calendar}" BasedOn="{StaticResource {x:Type Calendar}}">
            <Setter Property="CalendarItemStyle" Value="{StaticResource Custom.Styles.CalendarItem}" />
        </Style>
    </mah:DateTimePicker.CalendarStyle>
</mah:DateTimePicker>

with this style for the calendar items

<Style x:Key="Custom.Styles.CalendarItem" TargetType="{x:Type CalendarItem}" BasedOn="{StaticResource MahApps.St…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by punker76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4504 on October 16, 2024 11:44.