Version

Setting a Path for xamCarouselListBox to Use

In Creating a Named Path on the Artboard, we create a path that we could use to define a custom path for xamCarouselPanel™, xamDataCarousel™, xamCarouselListBox™, or xamDataPresenter™ to use. The purpose of this topic is to show you how to take that path, and apply it to your xamCarouselListBox.

Note
Note

This topic assumes you already have setup your xamCarouselListBox. For more information on how to do this, see Adding xamCarouselListBox to Your Application.

  1. First you need to copy your path you created from your Microsoft® Expression® Blend project into your Visual Studio project. The Window1.xaml is the default window for Blend projects so your path should be defined in this file.

  2. Once you have copied your path, paste it into the resource section of your project.

  3. Doing this will cause an error if you compile it right now. This error occurs because the path is in the resource section, and all items in the resource section must have a Key assigned to them. So specify a Key for your path.

  4. You can remove from the path the Fill, Stretch, and Stroke settings that Blend has set, as the xamCarouselListBox won’t need them. You can also leave them if you would like to see the path that your items follow inside the xamCarouselListBox.

  5. Below your XamCarouselListBox’s opening tag, place the following example code. This code creates a ViewSettings, which contains a CarouselViewSettings that has the ItemPath property that you assign your custom path too, by specifying the Key you assigned to the path.

In XAML:

<igWindows:XamCarouselListBox.ViewSettings>
        <igWindows:CarouselViewSettings ItemPath="{StaticResource myPath}"/>
</igWindows:XamCarouselListBox.ViewSettings>
  1. If you run the project you will see the xamCarouselListBox items follow the path that you have defined.

setting a path for xamcarousellistbox to use