How do I change the ItemPath within the C# code. We want to make the XAMDataCarousel a control with some constructor properties so that it will be a vertical or horizontal carousel. I have both of them laid out as I want them in the XAML, I'm just having a hard time change it.
Hello,
As you have defined them in the XAML, you can get them as resources and apply them to the ViewSettings.ItemPath property of the xamDataCarousel.
Here is an example how to get the path from the XamDataCarousel.Resources section and apply it to the carousel:
xamDataCarousel1.ViewSettings.ItemPath = xamDataCarousel1.Resources["path1"] as Path;
Hope this helps,
Alex.
Actually I had the paths defined within the XAML and when I load the carousel, one of the constructors is what layout I want (ItemPath Names: vertical and horizontal.
I simply use xamDataCarousel1.ViewSettings.ItemPath = vertical or
I simply use xamDataCarousel1.ViewSettings.ItemPath = horizontal
whatever I'm looking for. I doesn't get much easier than that!