RadEntry BorderStyle not attaching from Theme

0 Answers 70 Views
Entry Styling
n/a
Top achievements
Rank 1
Iron
n/a asked on 21 Sep 2023, 11:47 AM | edited on 21 Sep 2023, 12:18 PM

I using Light and Dark themes in my app.

In each theme I set Styles for BorderStyle and RadEntry.

<telerikInput:BorderStyle x:Key="EntryBorderStyle"
                          CornerRadius="5"
                          BorderColor="{DynamicResource PrimaryColor}"
                          BorderThickness="1"/>

<Style TargetType="{x:Type telerikInput:RadEntry}">
    <Setter Property="BackgroundColor" Value="{DynamicResource EntryBackgroundColor}" />
    <Setter Property="TextColor" Value="{DynamicResource TextThemeColor}" />
    <Setter Property="BorderStyle" Value="{DynamicResource EntryBorderStyle}" />
    <Style.Triggers>
        <Trigger TargetType="telerikInput:RadEntry" Property="IsEnabled" Value="False">
            <Setter Property = "TextColor" Value="{DynamicResource DisabledTextColor}"/>
        </Trigger>
    </Style.Triggers>
</Style>

but when I use RadEntry on ContentPage, styles are not attached properly, BorderColor not work after app start.

The only way to properly working Style is to add styles to ContentPage.Resources, remove entry and add again and HotReload page.

I also check solution with adding StaticResource in App.xaml:

<Application.Resources>
    <ResourceDictionary>
        <telerikInput:BorderStyle x:Key="EntryBorderStyle"
                                CornerRadius="5"
                                BorderColor="{DynamicResource PrimaryColor}"
                                BorderThickness="1"/>

        <telerikInput:BorderStyle x:Key="EntryErrorBorderStyle"
                                CornerRadius="5"
                                BorderColor="{DynamicResource ErrorColor}"
                                BorderThickness="1" />

        <Style TargetType="telerikInput:RadEntry">
            <Setter Property="BorderStyle" Value="{StaticResource EntryBorderStyle}" />
            <Setter Property="BackgroundColor" Value="{DynamicResource EntryBackgroundColor}" />
            <Setter Property="TextColor" Value="{DynamicResource TextThemeColor}" />
            <Style.Triggers>
                <Trigger TargetType="telerikInput:RadEntry" Property="IsEnabled" Value="False">
                    <Setter Property = "TextColor" Value="{DynamicResource DisabledTextColor}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
and it alos doesn't work.

 

Didi
Telerik team
commented on 25 Sep 2023, 11:57 AM

Hi Maciej,

Could you please send me the files or a sample how the themes are change? I want to review the implementation and test the exact setup on my side. 

n/a
Top achievements
Rank 1
Iron
commented on 15 Nov 2023, 01:26 PM

Hi,

are you asking how app set theme at startup?
I think I need to prepare repro project for it, because it is too complex for pasting code in forum.

Didi
Telerik team
commented on 15 Nov 2023, 02:28 PM

Yes, I will need a sample app to check the exact setup. If it is possible isolate the issue in a sample app and send the project to us for further research. If you do not want to share the project in the forum, open a support ticket and attach it there. 

No answers yet. Maybe you can help?

Tags
Entry Styling
Asked by
n/a
Top achievements
Rank 1
Iron
Share this question
or