Setting style for CoverFlow

2 posts, 0 answers
  1. Anj
    Anj avatar
    8 posts
    Member since:
    Jul 2010

    Posted 17 Aug 2010 Link to this post

    I have a RadCoverFlow control which contains an itemtemplate with an Image and a TextBlock. I need to set style for Image and TextBlock at runtime. I will load my styles at runtime and then I need to set the style in the code behind.

    I created a style for ListBoxItem and defined fontsize, fontweight etc and when I set this to coverFlow.ItemContainerStyle, I can see the style applied to the text. How do I achieve the same thing for images? Say, I want all images to be of the same size, how do I achieve this?
  2. Pana
    Pana avatar
    748 posts

    Posted 20 Aug 2010 Link to this post

    Hello Ana,

    Perhaps you can create an ItemContainerStyle based on CoverflowItem instead of ListBoxItem which will be one step closer to the right solution. As for the size of the images you can apply ItemTemplate on the CoverFlow. In that ItemTemplate you can position the text and the image and set fixed Width and Height for the image.

    I am not sure I understand what do you mean by "Set style at runtime". When are you going to apply that style? Is it going to be different for the different images? If you are using MVVM and the ItemsSource of the RadCoverflowItem than you can create a Width and Height properties on the view model items and bind the Image's Width and Height to the view model Width and Height pretty much as you would bind the Image's Source.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top