Appearance and Styling in UWP DatePicker (SfDatePicker)

22 Jul 20262 minutes to read

Accent Brush

The AccentBrush property is used to decorate the hot spots of a control with a solid color.

  • XAML
  • <Page
       ...
       xmlns:input="using:Syncfusion.UI.Xaml.Controls.Input">
    
        <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    
                <syncfusion:SfDatePicker  VerticalAlignment="Center"
    
                                        HorizontalAlignment="Center"
    
                                        Width="200"
    
                                        AccentBrush="Green"/>
    
        </Grid>
    
    </Page>

    The following image shows the control with various accent brushes:

    Appearance-and-Styling_img1

    Selected Foreground

    The SelectedForeground property is used to change the foreground color of the selected date.

  • XAML
  • <Page
       ...
       xmlns:input="using:Syncfusion.UI.Xaml.Controls.Input">
    
        <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    
                <syncfusion:SfDatePicker VerticalAlignment="Center"
    
                                 HorizontalAlignment="Center"
    
                                 Width="200">
    
                    <syncfusion:SfDatePicker.SelectorStyle>
    
                        <Style TargetType="syncfusion:SfDateSelector">
                         
                            <Setter Property="SelectedForeground" Value="Red"/>
                            
                        </Style>
    
                    </syncfusion:SfDatePicker.SelectorStyle>
    
                </syncfusion:SfDatePicker>
    
        </Grid>
    
    </Page>

    Appearance-and-Styling_img2