Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > CoverFlow > Alternating styles in RadCoverFlowItem

Not answered Alternating styles in RadCoverFlowItem

Feed from this thread
  • Gilmar avatar

    Posted on Aug 25, 2011 (permalink)

    I have a problem in control RadCoverFlowI have two types of styles that can be used inRadCoverFlowItem depending on the type of content that may be an image or a videoI would assumethat the RadCoverFlowItem style alternately according to the contents but but nothing appears. How can I fix this? Below is my code and my style. thanks


    <converter:MultimidiaConverter x:Key="multimidiaConverter">
                <converter:MultimidiaConverter.ImagemStyle>
                    <Style x:Name="Imagem" TargetType="telerik:RadCoverFlowItem">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="telerik:RadCoverFlowItem">
                                    <Border BorderThickness="1" BorderBrush="#FFC4D1E0">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="204*"/>
                                                <RowDefinition Height="20"/>
                                            </Grid.RowDefinitions>                                    
                                            <Image Grid.Row="0" Source="{Binding biDocumento, Converter={StaticResource byteArrayToImageConverter}, Mode=TwoWay}">
                                                <Image.Effect>
                                                    <DropShadowEffect BlurRadius="3" ShadowDepth="3" Opacity="0.365" Direction="328"/>
                                                </Image.Effect>
                                            </Image>
                                            <telerik:RadDockPanel Grid.Row="1" FlowDirection="LeftToRight" Margin="0">
                                                <telerik:RadDockPanel.Background>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#FF737A9B" Offset="0"/>
                                                        <GradientStop Color="#FF374270" Offset="1"/>
                                                        <GradientStop Color="#FF576087" Offset="0.5"/>
                                                        <GradientStop Color="#FF374270" Offset="0.5"/>
                                                    </LinearGradientBrush>
                                                </telerik:RadDockPanel.Background>                                        
                                                <Button Content="Button" Margin="0,0,8,0" HorizontalAlignment="Right" Width="20" Click="SelecionarDocumento_Click" 
                                                        IsEnabled="{Binding DataContext.EmEdicao, ElementName=ctcMultimidia}"
                                                        Style="{StaticResource botaoPesquisar}"/>
                                            </telerik:RadDockPanel>
                                        </Grid>
                                    </Border>                                    
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </converter:MultimidiaConverter.ImagemStyle>
                <converter:MultimidiaConverter.VideoStyle>
                    <Style x:Name="Video" TargetType="telerik:RadCoverFlowItem">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="telerik:RadCoverFlowItem">
                                    <Border BorderThickness="1" BorderBrush="#FFC4D1E0">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="204*"/>
                                                <RowDefinition Height="20"/>
                                                <RowDefinition Height="20"/>
                                            </Grid.RowDefinitions>
                                            <ContentControl x:Name="ctcVideo" 
                                                            Content="{Binding biDocumento, Converter={StaticResource byteArrayToVideoConverter}, Mode=TwoWay}" 
                                                            Grid.Row="0" 
                                                            Background="Transparent" 
                                                            Margin="1"/>
                                            <telerik:RadSlider x:Name="sliderVideo" 
                                                               Minimum="0" Maximum="1" 
                                                               Grid.Row="1" 
                                                               IsMoveToPointEnabled="True" IsMouseWheelEnabled="True" IsSnapToTickEnabled="False"
                                                               TickFrequency="0.1" 
                                                               Margin="1" />
                                            <telerik:RadDockPanel Grid.Row="2" FlowDirection="LeftToRight" Margin="0">
                                                <telerik:RadDockPanel.Background>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#FF737A9B" Offset="0"/>
                                                        <GradientStop Color="#FF374270" Offset="1"/>
                                                        <GradientStop Color="#FF576087" Offset="0.5"/>
                                                        <GradientStop Color="#FF374270" Offset="0.5"/>
                                                    </LinearGradientBrush>
                                                </telerik:RadDockPanel.Background>
                                                <Button Content="Button" Margin="8,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="20" Click="RetornarVideo_Click" Style="{StaticResource botaoRetornarVideo}"/>
                                                <Button Content="Button" Margin="8,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="20" Click="PararVideo_Click" Style="{StaticResource botaoPararVideo}"/>
                                                <Button Content="Button" Margin="8,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="20" Click="TocarVideo_Click" Style="{StaticResource botaoTocarVideo}"/>
                                                <Button Content="Button" Margin="8,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="20" Click="AdiantarVideo_Click" Style="{StaticResource botaoAdiantarVideo}"/>
                                                <Button Content="Button" Margin="0,0,8,0" HorizontalAlignment="Right" Width="20" Click="SelecionarDocumento_Click" 
                                                        Style="{StaticResource botaoPesquisar}" IsEnabled="{Binding DataContext.EmEdicao, ElementName=ctcMultimidia}"/>
                                            </telerik:RadDockPanel>                                    
                                        </Grid>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </converter:MultimidiaConverter.VideoStyle>
    </converter:MultimidiaConverter>




    <telerik:RadCoverFlow x:Name="cofMultimidia" 
                                          Grid.Row="1"                                                                            
                                          ItemsSource="{Binding Items, Mode=TwoWay}"
                                          Grid.RowSpan="2" Grid.ColumnSpan="2">
                <telerik:RadCoverFlow.ItemTemplate>
                    <DataTemplate>
                        <telerik:RadCoverFlowItem Template="{Binding ItemSelecionado, Converter={StaticResource multimidiaConverter}}"
                                                  Content="{Binding ItemSelecionado}" />                    
                    </DataTemplate>
                </telerik:RadCoverFlow.ItemTemplate>
            </telerik:RadCoverFlow>

    Reply

  • Valeri Hristov Valeri Hristov admin's avatar

    Posted on Aug 30, 2011 (permalink)

    Hello Gilmar,

    The problem is that you are putting a second RadCoverFlowItem inside each RadCoverFlowItem and your styles are applied only on the inner item. I am afraid that we don't have a solution for your requirement - you need a ItemContainerStyleSelector property, that is not available on the standard ItemsControl in Silverlight.

    Greetings,
    Valeri Hristov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > CoverFlow > Alternating styles in RadCoverFlowItem
Related resources for "Alternating styles in RadCoverFlowItem"

Silverlight CoverFlow Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]