Approved
Last Updated: 16 Aug 2018 13:26 by ADMIN
wu
Created on: 13 Nov 2017 00:34
Category: Carousel
Type: Bug Report
0
Carousel: When TopItemPathFraction property of RadCarouselPanel is set to value different than 0.5 the mouse navigation doesn't behaves properly
When adjust the carousel's PathFraction parameter,look the attach's image file,In the demo,click the left or right's image by mouse,the image can't move the new largest position,but don't adjust the pathfraction parameter,the default's value is 0.5,click the left or right's image .the image can move the current position(we feel the largest position is the current selected item position).

Edit: To work this around you can disable the default logic executed on click in the carousel and implement the moving with custom code. You can do that in the PreviewMouseLefButtonDown event of the  RadCarouselPanel control. Here is an example in code:

private void carouselPanel_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
	e.Handled = true;

	var position = e.GetPosition(this.carouselPanel);
	var hitTestResult = VisualTreeHelper.HitTest(this.carouselPanel, position);
	var image = hitTestResult.VisualHit as Image;
	if (image != null)
	{
		var newTopIndex = this.carouselPanel.Children.IndexOf(image);
		var currentTopIndex = this.carouselPanel.Children.IndexOf(this.carouselPanel.TopContainer);
		var displacement = newTopIndex - currentTopIndex;
		this.carouselPanel.MoveBy(displacement);
	}
}
Attached Files:
4 comments
ADMIN
Martin
Posted on: 16 Aug 2018 13:26
Hello Wu,

Excuse me for the delay and thank you for the new information. If you still experiencing this may I ask you to open a new support ticket and attach a runnable project showing the issue there?

Regards,
Martin Ivanov
Technical Support Engineer
wu
Posted on: 19 Jan 2018 09:22
pls look the attach file,the top image is the left bottom image ,when using the wheel switch the image ,the top image is shielded.
Attached Files:
wu
Posted on: 19 Jan 2018 09:13
OK,It is good ,but if the Panel is cycle show,when click the next cycle's image,the image's move path is reverse,especially switch the image by wheel,the next cycle's first image will be
shielded.
ADMIN
Martin
Posted on: 17 Jan 2018 14:06
Hello Wu Yang

Thank you for the report. We modified the title a bit and approved it. To work this around you can disable the default logic executed on click in the carousel and implement the moving with custom code. You can do that in the PreviewMouseLefButtonDown event of the  RadCarouselPanel control. Here is an example in code:

private void Panel_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
	e.Handled = true;

	var position = e.GetPosition(this.carouselPanel);
	var hitTestResult = VisualTreeHelper.HitTest(this.carouselPanel, position);
	var image = hitTestResult.VisualHit as Image;
	if (image != null)
	{
		var newTopIndex = this.carouselPanel.Children.IndexOf(image);
		var currentTopIndex = this.carouselPanel.Children.IndexOf(this.carouselPanel.TopContainer);
		var displacement = newTopIndex - currentTopIndex;
		this.carouselPanel.MoveBy(displacement);
	}
}

Regards,
Martin Ivanov
Technical Support Engineer