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

Spread out items in carousel

1 Answer 97 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Caden
Top achievements
Rank 1
Caden asked on 29 Mar 2021, 09:54 PM

I'm trying to spread out the items in my carousel so there is a bit of space between them (and ideally no change in z depth as they animate).

It seems like the items can only spread out to the edges of the screen. In my case I need 3 landscape images visible at once.

Instead of overlapping 3 images on screen like |[--][--][--]| where the center image is raised/focused, I'd like [-|-][--][-|-] where the side images are the same size and partially off screen.

I've tried the following, as well as using bezier curves with control points, etc.

<Path x:Key="horizontalPath" Stretch="Fill">
  <Path.Data>
     <LineGeometry StartPoint="-1000,0" EndPoint="1000,0" />
  </Path.Data>
</Path>

 

 

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 01 Apr 2021, 09:30 AM

Hello Caden,

In order to achieve the described functionality I can suggest manually dividing the available Width among the CarouselItems. Additionally, you can position the items by modifying their RenderTransform. You can do that by inheriting the RadCarouselPanel and overriding the ArrangeOverride method. 

I am attaching a sample project to demonstrate what I have in mind. Note, that the suggested approach is a customization and I have not tested it extensively. That said, I do hope that you will find it useful as a starting point. Of course, feel free to modify the demonstrated approach in order to adapt it to your specific scenario. 

Regards,
Vladimir Stoyanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Carousel
Asked by
Caden
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or