I have the following xaml:
On the UserControl loaded event I have the following:
Most of the time this works fine. However occasionally the FindCarouselPanel will return null instead of the panel? Am I doing something wrong? Is there anything I can do to prevent this?
<telerik:RadCarousel Name="myCarousel" HorizontalContentAlignment="Stretch" VerticalAlignment="Top" VerticalContentAlignment="Center" Height="43" Padding="0" IsSynchronizedWithCurrentItem="True" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" Background="{x:Null}" Margin="25,0,2,0" PreviewMouseDown="effectiveDateCarousel_PreviewMouseDown" PreviewKeyDown="effectiveDateCarousel_PreviewKeyDown" PreviewMouseWheel="effectiveDateCarousel_PreviewMouseWheel"> <telerik:RadCarousel.ItemsPanel> <ItemsPanelTemplate> <telerik:RadCarouselPanel HorizontalAlignment="Stretch" VerticalAlignment="Center" Path="{StaticResource path}" IsSelectedTopItem="True" /> </ItemsPanelTemplate>
</telerik:RadCarousel.ItemsPanel></telerik:RadCarousel>On the UserControl loaded event I have the following:
RadCarouselPanel panel = myCarousel.FindCarouselPanel();panel.ItemsPerPage = 7;Most of the time this works fine. However occasionally the FindCarouselPanel will return null instead of the panel? Am I doing something wrong? Is there anything I can do to prevent this?