Version

Adding xamCarouselListBox to Your Application

When you first start working with a new control, you may not know where to begin. This topic will walk you through, from the beginning, how to create the xamCarouselListBox™ control and data bind it using XAML.

The xamCarouselListBox control arranges items along a path. To modify this path, see Setting a Path for xamCarouselListBox to Use. For more data binding options, see the Data Binding section of the General Programming Concepts.

  1. Create a Microsoft® Windows® Presentation Foundation Window or Page project.

  2. For easier access to xamCarouselListBox, place the following namespace declaration inside the opening Page or Window tag.

In XAML:

xmlns:igWindows="http://infragistics.com/Windows"
  1. Create a resources section defining an XmlDataProvider. The XmlDataProvider references the Orders XML file. Place the following XAML inside the Grid Panel.

In XAML:

<Grid.Resources>
        <XmlDataProvider Source="../Data/Orders.xml"
          x:Key="OrderData" XPath="/Orders" />
</Grid.Resources>
  1. Create an instance of XamCarouselListBox and set the ItemSource property to the XmlDataProvider created in the previous step.

In XAML:

<igWindows:XamCarouselListBox
  ItemsSource="{Binding Source={StaticResource OrderData}, XPath=Order}"/>
  1. Build and run the project. You should see xamCarouselListBox populated with data similar to the image below.

xamcarousellistbox that results from above steps.

The xamCarouselListBox control displays the data, but not very well at first. You can remedy this by creating an ItemTemplate for xamCarouselListBox. Using an ItemTemplate, you can display the data however you need. For more information on ItemTemplates, see Working with the ItemTemplate.