RadEntry always have background color is white

1 Answer 47 Views
Entry
Le
Top achievements
Rank 1
Iron
Le asked on 06 Dec 2023, 06:02 PM | edited on 07 Dec 2023, 07:54 AM

Hello,

Even though I have set up VisualState for RadEntry as below; However, RadEntry always has a default background color of white when receiving focus (mouse click) - in WINDOWS platform, it only changes color as in the VisualState setting after moving the mouse out later. Please explain and guide how to solve the problem.


<VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="CommonStates">
        
        <VisualState x:Name="Normal">
            <VisualState.Setters>
                <Setter Property="BackgroundColor" Value="{AppThemeBinding Dark={StaticResource DarkMode_FrameBackground}, Light= {StaticResource LightMode_FrameBackground}}"/>
            </VisualState.Setters>
        </VisualState>

        <VisualState x:Name="PointerOver">
            <VisualState.Setters>
                <Setter Property="BackgroundColor" Value="#336699"/>
            </VisualState.Setters>
        </VisualState>

        <VisualState x:Name="Focused">
            <VisualState.Setters>
                <Setter Property="BackgroundColor" Value="#336699" />
            </VisualState.Setters>
        </VisualState>

    </VisualStateGroup>
</VisualStateManager.VisualStateGroups>

Le
Top achievements
Rank 1
Iron
commented on 07 Dec 2023, 10:42 AM

Any one of you can help me?

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Didi
Telerik team
answered on 07 Dec 2023, 01:38 PM

Hello,

If you want to change the background color of the RadEntry control you have to set the Visual States to the native element. I have attached a sample. Check the native element styling inside the Platforms/Windows/App.xaml file.

Regards,
Didi
Progress Telerik

A brand new .NET MAUI course was just added to the Virtual Classroom. The training course is developed to help you get started with the Telerik UI for .NET MAUI components and features. It aims to put you in the shoes of an engineer who adds new features to an existing application. You can check it out at https://learn.telerik.com
Le
Top achievements
Rank 1
Iron
commented on 07 Dec 2023, 05:00 PM

Thanks Didi! Your supports help me alot!
Tags
Entry
Asked by
Le
Top achievements
Rank 1
Iron
Answers by
Didi
Telerik team
Share this question
or