Skip to content

How do I change DaysOfWeek TextColor? #188

Answered by ME-MarvinE
diegomotti asked this question in Q&A
Discussion options

You must be logged in to vote

Currently this is only supported through templating since the default template is just a label.

The CalendarView's DayNameTemplate property can be set to a DataTemplate with a Label inside it. Then you just change the Label colour.

Here's a code snippet of the DataTemplate the MAUI CalendarView uses by default:

 <DataTemplate x:DataType="{x:Type System:DayOfWeek}">
     <Label
        FontSize="15"
        HorizontalTextAlignment="Center"
        Text="{Binding ., Converter={StaticResource.LocalizeDayOfWeekAndCharLimitConverter}, ConverterParameter=3}"
        TextColor="Black"
        VerticalTextAlignment="Center"/>
</DataTemplate>

LocalizeDayOfWeekAndCharLimitConverter is a ValueConverter

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ME-MarvinE
Comment options

You must be logged in to vote
0 replies
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