RadTabTitem styling

2 posts, 0 answers
  1. FirstName
    FirstName avatar
    4 posts
    Member since:
    Sep 2017

    Posted 08 Nov Link to this post

    Hi, everyone. For example, I have such chunk of code:

    01.<telerik:RadTabControl
    02.    Name="someNamehere"
    03.    HorizontalAlignment="Stretch"
    04.    Height="100" Margin="7"
    05.    VerticalAlignment="Center"
    06.    Foreground="anyColor"
    07.    telerik:TouchManager.IsTouchHitTestVisible="False"
    08.    BorderThickness="1 3 1 1"
    09.    BorderBrush="{telerik:Windows8Resource ResourceKey=BasicBrush}"
    10.    Style="{DynamicResource InnovaRadTabControlStyle}"
    11.    ItemsSource="{Binding anyViewModelHere, UpdateSourceTrigger=PropertyChanged}"
    12.    SelectedIndex="{Binding anyIndexValueHere, UpdateSourceTrigger=PropertyChanged}">
    13. 
    14.    <telerik:RadTabControl.Resources>
    15.        <Style TargetType="telerik:RadTabItem" BasedOn="{StaticResource CustomStyleHere}">
    16.            <Setter Property="HeaderForeground" Value="Red"/>
    17.        </Style>
    18.    </telerik:RadTabControl.Resources>
    19.    <telerik:RadTabControl.ContentTemplate>
    20.        <DataTemplate DataType="Unit1:ViewModel2Here">
    21.        <unit1:ViewModel2 DataContext="{Binding DataContext, RelativeSource={RelativeSource Self}, UpdateSourceTrigger=PropertyChanged}"/>
    22.    </DataTemplate>
    23.    </telerik:RadTabControl.ContentTemplate>
    24.</telerik:RadTabControl>

     

    Why style for telerik:RadTabItem (lines 14-18) is not working at all ? Thanks in advance !

  2. Sia
    Admin
    Sia avatar
    694 posts

    Posted 10 Nov Link to this post

    Hello,
     
    I am not sure what is behind CustomStyleHere. If it is a custom style that targets RadTabItem and you use implicit styling, it should be based on the Telerik RadTabItemStyle that we provide with our source. However I have tested on my end the following custom style (in the RadTabControl.Resources) and it works as expected:
    <Style TargetType="telerik:RadTabItem" BasedOn="{StaticResource RadTabItemStyle}">
        <Setter Property="HeaderForeground" Value="Red"/>
    </Style>

    If you use StyleManager, just remove the BasedOn from the style above.
    In case you still experience issues with this style, I would appreciate if it is possible to send us a small project with all related customizations.

    Regards,
    Sia
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top