Version

Setting a Path for xamCarouselPanel 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™ or xamCarouselListBox™ to use. The purpose of this topic is to show you how to take that path, and apply it to your xamCarouselPanel.

Note
Note

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

  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 xamCarouselPanel.

  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:XamCarouselPanel.ViewSettings>
        <igWindows:CarouselViewSettings ItemPath="{StaticResource myPath}"/>
</igWindows:XamCarouselPanel.ViewSettings>
  1. If you run the project you will see the xamCarouselPanel items follow the path that you have defined.

setting a path for xamcarouselpanel to use