I am binding my RadCarousel to a Generic List and cannot get my binding setup correctly. I have the following XAML for my CarouselDataRecordPresenter and this is where my binding is setup:
SceneCarousel.xaml
Below that, my Carousel is setup like so:
SceneCarousel.xaml
I am trying to bind to a List<CarouselDataItem> which is this class:
CarouselDataItem.cs
My issue is getting the DataItem to pass to my CarouselItem UserControl because I don't know how to setup the binding. Whatever I need to put in place of "{Binding Path=CarouselItems}", I can't figure out because it always comes up NULL in my CarouselItem UserControl.
SceneCarousel.xaml
<Style TargetType="{x:Type telerik:CarouselDataRecordPresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type telerik:CarouselDataRecordPresenter}"> <carousel:CarouselItem DataItem="{Binding Path=CarouselItems}" /> </ControlTemplate> </Setter.Value> </Setter></Style>Below that, my Carousel is setup like so:
SceneCarousel.xaml
<telerik:RadCarousel Name="Scenes" Background="Transparent" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled" Loaded="LoadCarousel"> <telerik:RadCarousel.ItemsPanel> <ItemsPanelTemplate> <telerik:RadCarouselPanel AutoLoadItems="false" ItemsPerPage="5" TopContainerChanged="RadCarouselPanel_TopContainerChanged" /> </ItemsPanelTemplate> </telerik:RadCarousel.ItemsPanel></telerik:RadCarousel>I am trying to bind to a List<CarouselDataItem> which is this class:
CarouselDataItem.cs
public class CarouselDataItem{ public SceneReference Reference { get; set; } public string ImagePath { get; set; } public Stretch ImageStretch { get; set; } public HorizontalAlignment TitleAlignment { get; set; } public Visibility ShowDeleteButton { get; set; } public bool AddScene { get; set; }}My issue is getting the DataItem to pass to my CarouselItem UserControl because I don't know how to setup the binding. Whatever I need to put in place of "{Binding Path=CarouselItems}", I can't figure out because it always comes up NULL in my CarouselItem UserControl.