Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Use Built-in Path Types

This example shows how to use the ItemMovingPath property to specify a path for a CarouselPanel.

The path assigned to this property is retrieved from a specific resource (ResourceId=Ellipse) defined in the DXCarousel library. Other built-in path types include: HalfEllipse, Line, Angle, Arc, Rectangle, Sine, and Spiral.

<Window x:Class="CarouselItemMovingPath.Window1" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:dxca="http://schemas.devexpress.com/winfx/2008/xaml/carousel"
        Title="Window1" Height="300" Width="300" >
    <Grid>
        <Grid.Resources>
            <Style TargetType="{x:Type Rectangle}" 
                   BasedOn="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type dxca:CarouselPanel}, ResourceId=advancedCarouselItemStyle}}" />
        </Grid.Resources>

        <dxca:CarouselPanel Margin="12" Name="carouselPanel1" VisibleItemCount="5" ActiveItemIndex="2" 
                            ItemMovingPath="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type dxca:CarouselPanel}, ResourceId=Ellipse}}">
            <Rectangle Fill="Red" />
            <Rectangle Fill="Green" />
            <Rectangle Fill="Blue" />
            <Rectangle Fill="Yellow" />
            <Rectangle Fill="Beige" />
        </dxca:CarouselPanel>
    </Grid>
</Window>