dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.95k stars 1.7k forks source link

Set DatePicker Style #13169

Open acaliaro opened 1 year ago

acaliaro commented 1 year ago

Description

Currently it is possible to set some properties of the DatePicker, but only for the object displayed on the UI. In Android it seems that it is not possible to set, via "Style", the properties of the popup that appears when the DatePicker control is pressed. For example, it seems that to change the popup title color, you need to work on the Android styles (which seems to create problems as it also changes the style of the splashscreen: https://learn.microsoft.com/en-us/answers/questions/1047070/change-title-and-selected-date-colors-in-android-d). It would also be useful to change the settings of the dialog via netmaui handlers

Public API Changes

<Style TargetType="DatePicker">
        <Setter Property="TextColor" Value="{AppThemeBinding Light=White, Dark={StaticResource White}}" />
        <Setter Property="BackgroundColor" Value="Transparent" />
**<Setter Property="DialogTitleColor" Value="Red"**
        <Setter Property="FontFamily" Value="OpenSansRegular" />
        <Setter Property="FontSize" Value="Large" />
        <Setter Property="MinimumHeightRequest" Value="44" />
        <Setter Property="MinimumWidthRequest" Value="44" />
        <Setter Property="VisualStateManager.VisualStateGroups">
            <VisualStateGroupList>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="Disabled">
                        <VisualState.Setters>
                            <Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
                        </VisualState.Setters>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateGroupList>
        </Setter>
    </Style>

Intended Use-Case

The request is motivated by being able to manage the styles of the dialog that appears when the DatePicker control is pressed without having to touch the Android styles. I think this could also be useful for the TimePicker and the various Dialogs in general

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.