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>
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.
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.