Is it possible to force the xamDataCarousel to navigate between items without using the navigator control? I would like to be able to move the mouse towards the next item in the carousel and have the motion take effect. This behaviour would be similar to the Hyperbar control that ships with expression blend tutorials and shown here:http://blogs.msdn.com/expression/articles/516599.aspxThe xamDataCarousel is more flexible than the above control and simply looks better but I really want to duplicate the mouse generated navigation that the hyperbar displaysThanks
There are several ways to do this. Keep in the mind the CarouselPanelNavigator comes with navigation commands for moving the carousel.
I created a sample project which contains an EventHandler for MouseDown events on the objects contained within a carousel. This is where you have a lot of room for approaching this differently. The main thing is you need to act on the mouse down on the item in the carousel, determine which way to move the carousel and navigate to the next or previous item n number of moves in order to display the clicked item in the designated top spot.
I will make this sample public in an Infragistics blog. Until then, if you would like me to email the sample project directly to you, leave me your email address in an email to me:
To send me an email, click on my name on the left and look for the Send Email to this User link in the lower left corner.
I've found that supporting this functionality in the xamCarouselListBox simpler than in the other carousels.
The following code works in samples I've created. Let me know if you find a flaw with this approach in your setup.
The following code assumes you are displaying an odd number of list items (as specified in ViewSettings.ItemsPerPage) and that you want the selected item to scroll to the middle visible position.
<igWindows:XamCarouselListBox x:Class="XamApp.CarouselListBox" x:Name="carouselList" SelectionChanged="OnSelectionChanged">
private void OnSelectionChanged(object sender, SelectionChangedEventArgs e){ int offset = carouselList.ViewSettings.ItemsPerPage / 2; carouselList.ScrollInfo.SetVerticalOffset(carouselList.SelectedIndex - offset);}