Controlling the spread of images?

3 posts, 1 answers
  1. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 07 Nov 2008 Link to this post


    I can't find anything in the properties of the control that do this, but I was curious if it was possible (maybe through editing the item template(s) of Coverflow?).

    Currently, and pardon my ascii art, but coverflow displays like this (with the [-] being the current selection):


    With all the images relatively close together.  Looks and works great, but I was wondering if there was a way to add a margin or padding between images on the display, so instead of them being close together and kinda overlapping, that they would be like...

    \  \  \  \  [-]  /  /  /  /

    More or less I'm trying to do with Coverflow a bit of what you can do with the WPF Carousel control, customizing the template a bit, but can't figure out how. Any suggestions would be great. ;)

  2. Answer
    Miroslav Nedyalkov
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 11 Nov 2008 Link to this post

    Hi Serrin,

    To change the distance between the items you need to override the ItemsPanelTemplate of the CoverFlow.

    Currently, the CoverFlow control uses our AutoCenterPanel that has a property called ArrangeStrategy. This property is currently set to PositionsBasedArrangeStrategy (the only one available and supported by us at this time). This strategy also exposes a property called PositionDefinitions that is a collection of PositionDefinitions. Supported definitions at this time are RelativeWidthPositionDefinition and FixedWidthPositionDefinition that tell the CoverFlow how much room it holds for each item.
    The first one is for the centered item, whereas the second one is for the left and right items that are next to the centered item. The last one describes the rest.

    In the project I am sending to you, you can find the XAML code that sets the current configuration (the ItemsPanelTemplate with key CoverFlowItemsPanelTemplate).

    As for your second question - to change the orientation of the items (rotation angles, ZPositions, etc.) you need to override the ControlTemplate of the CoverFlow item. To accomplish this you can create a style for the RadCoverFlowPerspectiveItem and set its ControlTemplate in the style. In the attached example I am setting the currently used ControlTemplate.

    If you have more questions, we will be happy to answer them.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Serrin
    Serrin avatar
    286 posts
    Member since:
    Sep 2008

    Posted 11 Nov 2008 Link to this post

    Wow, between you and Hristo (in the menu post) I think I've effectively doubled my knowledge of Silverlight today. :)

    Many thanks!
Back to Top