How to apply style fo selected Items backgroung is change.

1 posts, 0 answers
  1. jitendra jadav
    jitendra jadav avatar
    1 posts
    Member since:
    Oct 2009

    Posted 10 Nov 2011 Link to this post

    Hello everyone,

    I am using telerik:RadCarousel control and I want to apply style for selected item should be highlighted some different color so I am using some triggers but it will give me error.I am using telerik triggers
    like this
    <ControlTemplate.Triggers>
        <Trigger Property="IsSelected" Value="True" >
            <Setter TargetName="CarouselItemMainBorder" Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="108,472" StartPoint="108,23" MappingMode="Absolute">
                        <GradientStop Color="#FF344B97" Offset="0"/>
                        <GradientStop Color="#FF000000" Offset="1"/>
                        <GradientStop Color="#FF233F7E" Offset="0.045"/>
                        <GradientStop Color="#FF000000" Offset="0.0451"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter TargetName="CarouselItemInnerBorder" Property="Background">
                <Setter.Value>
                    <LinearGradientBrush  EndPoint="101,462" StartPoint="101,13" MappingMode="Absolute">
                        <GradientStop Color="#FF344B97" Offset="0"/>
                        <GradientStop Color="#FF000000" Offset="1"/>
                        <GradientStop Color="#FF233F7E" Offset="0.045"/>
                        <GradientStop Color="#FF000000" Offset="0.0451"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Trigger>
    </ControlTemplate.Triggers>

    and I have some Xaml like this.
    <telerikNavigation:RadCarousel Height="{Binding MainMenuHeight}" 
                               Width="{Binding MainMenuWidth}"
                               ItemsSource="{Binding Path=Menu.Options}"
                               SelectedItem="{Binding SelectedMainMenuOption, Mode=TwoWay}"
                               AutoGenerateDataPresenters="True" 
                               Background="Transparent"
                               HorizontalScrollBarVisibility="Disabled"
                               VerticalScrollBarVisibility="Disabled"
                               VerticalContentAlignment="Stretch"
                               IsSynchronizedWithCurrentItem="True"
                               CurrentItem="{Binding SelectedMainMenuOption, Mode=TwoWay}"
                               Focusable="False"
                               IsTabStop="False"
                               Grid.Row="2">
     
        <telerikNavigation:RadCarousel.ItemTemplate>
            <DataTemplate>
                <Border Focusable="True">
                    <StackPanel Orientation="Horizontal" Focusable="True">
                        <Image Source="{Binding IconPath}" Focusable="True"/>
                        <TextBlock Text="{Binding Title}" Focusable="True" VerticalAlignment="Center"/>
                    </StackPanel>
                </Border>
            </DataTemplate>
        </telerikNavigation:RadCarousel.ItemTemplate>
     
        <telerikNavigation:RadCarousel.ItemsPanel>
            <ItemsPanelTemplate>
                <telerikNavigation:RadCarouselPanel x:Name="radCarouselPanel"
                                                PathPadding="0"
                                                IsScalingEnabled="True"
                                                IsOpacityEnabled="False"
                                                ItemsPerPage="{Binding ItemsPerPage}"
                                                Path="{StaticResource menuPath}"
                                                CanVerticallyScroll="True"
                                                CanHorizontallyScroll="False"
                                                VerticalAlignment="Stretch"
                                                IsSelectedTopItem="True"
                                                Focusable="False">
                </telerikNavigation:RadCarouselPanel>
            </ItemsPanelTemplate>
        </telerikNavigation:RadCarousel.ItemsPanel>
         
    </telerikNavigation:RadCarousel>
    so how I can apply this kind of formate.

    Thank you.
Back to Top