Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2805
access xamCarouselPanel in xamCarouselListbox
posted

Hi,

Our project just started to use xamCarouselListbox and xamCarouselPanel. I found that some times xamCarouselListbox will be blank after click navigation button. I want to write code to make access xamCarouselListbox and force at least 1 list item is in it, but have no idea how to handle this.

Also, in xamCarouselListbox  how can I use xamCarouselPanel.executeCommand? How can I access xamCarouselPanel?

Thanks

Parents
No Data
Reply
  • 17559
    Verified Answer
    posted

    Hello TTran117,

     

    In order to control the rotation of the XamCaroiselListBox you can handle the event ExecutedComand of the contained XamCarouselPanel. This event will gets fired every time you click on the navigation buttons and you can perform an actions to disable the rotation. You can achieve this functionality as follows:

         private void carousel_Loaded(object sender, RoutedEventArgs e)

            {

                XamCarouselPanel panel = Utilities.GetDescendantFromType(carousel, typeof(XamCarouselPanel), true) as XamCarouselPanel;

                panel.ExecutedCommand += new EventHandler<Infragistics.Windows.Controls.Events.ExecutedCommandEventArgs>(panel_ExecutedCommand);

            }

     

            void panel_ExecutedCommand(object sender, Infragistics.Windows.Controls.Events.ExecutedCommandEventArgs e)

            {

                if (e.Command == XamCarouselPanelCommands.NavigateToPreviousItem )

                {

                   

                }

                else  {

                  

                }

            }

     

    Regarding your second question, you can check the following forum thread:

    http://community.infragistics.com/forums/t/62076.aspx

     

    If this doesn’t suit your scenario, please do not hesitate to ask.

Children
No Data