Hi,
I'm trying to use a XamCarouselPanel in a windows form. I want to change it from using the default eliptical path to a horizontal line.
I've tried doing something like this, but it still uses the eliptical path -
XamCarouselPanel carouselPanel = new XamCarouselPanel();
carouselPanel.Name =
"XamCarouselPanel";
carouselPanel.ViewSettings.ItemSize = new System.Windows.Size(bPanel1.Width, bPanel1.Height);
System.Windows.Shapes.
Line path = new System.Windows.Shapes.Line();
path.Stroke = System.Windows.Media.
Brushes.Gray;
path.X1 = 1;
path.X2 = 862;
path.Y1 = 169;
path.Y2 = 169;
path.HorizontalAlignment = System.Windows.
HorizontalAlignment.Center;
path.VerticalAlignment = System.Windows.
VerticalAlignment.Center;
We look at the code samples provided by Infragistics in your Mydocs and Settings->All Users->Shareddocs->Infragistics directory and pull open the XAMFeatureBrowser. We look at the carousel's paths(the ones that you can select on the fly) and when we find one, you take the name of that one and go to the xaml code....copy->paste it in the xaml code and then you have your path.
You can either set the path in the xaml or you can set it during runtime in the C# code with the Carouse.viewsettings.itempath = nameOfYourPathHere code
Hello,
You can use a Path that represents a straight line rather than using the Line. You can use the following code to accomplish this:PathFigure pf = new PathFigure();pf.StartPoint = new System.Windows.Point(1, 169);LineSegment ls = new LineSegment();ls.Point = new System.Windows.Point(862, 169);pf.Segments.Add(ls);PathGeometry pg = new PathGeometry();pg.Figures = new PathFigureCollection() { pf };System.Windows.Shapes.Path path = new System.Windows.Shapes.Path();path.Data = pg;carouselPanel.ViewSettings.ItemPath = path;When setting the path to a Line, it fails because internally we use the RenderedGeometry of the Shape. In the case of the line, RenderedGeometry.IsEmpty() always returns true and as a result we are using the default internal path for the XamCarouselPanel.
Please test this approach in your own application to see if it will meet your needs.
Alan
I am looking into this issue. I will post again when I have more details.