Hi,
I've noticed when playing with the Feature Browser that the mouse wheel works when the mouse is over the background of the control, but not when hovered over an item.
Specifically, I've styled one of our carousels the same as the "Auto-Scale Item Contents" example, which arranges the items in a vertical fashion. We are plugging in UserControls instead of using Images but have the same problem as seen in your example - when the mouse is over the background "ellipse" it works, but when hovered over one of the contained images, it does not.
I assume some part of the item must be handling the MouseWheel event, therefore not letting it bubble up to the CarouselPanel? Or is the panel itself forcing this behavior?
More importantly, is there anything I can do to ensure the mouse wheel always functions when the cursor is placed over any part of the control? (in the same way that your images don't have any reason to handle the mouse wheel - nor do my user controls, they can be thought of as static images too).
Regards,
Dave
Hello Dave,
The event is handled when you are mouse wheeling above an item, you can use the following code in the PreviewMouseWheel event:
void xamCarouselPanel1_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
if (e.Delta > 0)
xamCarouselPanel1.SetVerticalOffset(xamCarouselPanel1.VerticalOffset + 1d);
}
else
xamCarouselPanel1.SetVerticalOffset(xamCarouselPanel1.VerticalOffset -1d);
Thanks Alex,
Just what I was looking for.