ComponentOne Grid for WPF: Using Grid for WPF > Using the C1CarouselPanel Panel

Using the C1CarouselPanel Panel

In addition to the C1DataGrid grid control, ComponentOne Grid for WPF includes the C1CarouselPanel panel. The C1CarouselPanel is a panel allowing you to view content and controls – including standard or 3rd-party controls – in a carousel. The C1CarouselPanel is used in the carousel data view of the C1DataGrid control. Items in the panel revolve on a path when interacted with at run time.

To use the C1CarouselPanel to create a carousel-like interactive effect, you can set it as an ItemsControl control's panel and assign your visual elements collection to the ItemsControl.Items property. So, for example, in the XAML below an ItemsPanelTemplate template is defined in the Window's resources and includes the C1CarouselPanel panel. An ItemsControl containing arbitrary elements later points to the ItemsPanelTemplate template:

<Window x:Class="Window1" xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1grid=http://schemas.componentone.com/wpf/C1DataGrid Title="Window1" Height="231" Width="375">

    <Window.Resources>

        <!-- An ItemsPanelTemplate template defining the C1CarouselPanel. -->

        <ItemsPanelTemplate x:Key="carouselPanel">

            <c1grid:C1CarouselPanel />

        </ItemsPanelTemplate>

    </Window.Resources>

    <Grid>

<!-- An ItemsControl with ItemsPanel set to the ItemsPanelTemplate defining a C1CarouselPanel. -->

<ItemsControl ItemsPanel="{StaticResource carouselPanel}">

<!-- Arbitrary controls or images within the ItemsControl. -->

            <Image Width="51" Height="51" Source="image1.png"/>

            <Image Width="51" Height="51" Source="image2.png"/>

            <Image Width="51" Height="51" Source="image3.png"/>

            <Button Height="23" Name="Button1" Width="75">Button</Button>

</ItemsControl>

    </Grid>

</Window>


Customizing the Carousel


Send comments about this topic to ComponentOne.
Copyright © 1987-2010 ComponentOne LLC. All rights reserved.