This is a migrated thread and some comments may be shown as answers.

Controlling the spread of images?

2 Answers 97 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
Serrin
Top achievements
Rank 1
Serrin asked on 07 Nov 2008, 07:26 PM
Hello,

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. ;)

Thanks,
Serrin

2 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 11 Nov 2008, 09:43 AM
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.
0
Serrin
Top achievements
Rank 1
answered on 11 Nov 2008, 05:28 PM
Wow, between you and Hristo (in the menu post) I think I've effectively doubled my knowledge of Silverlight today. :)

Many thanks!
Tags
CoverFlow
Asked by
Serrin
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Serrin
Top achievements
Rank 1
Share this question
or