Hi, I have custom markers bound to a visibility checkbox. When the box is changed the position of the markers can shift dramatically. If I update the UI somehow (like zoom, scroll, etc...) it will fix itself. This only happens to my dynamically added charts via code behind. I've attached a small sample project showing the problem. I'm thinking I need a way to trigger an UpdateLayout when the visibility changes.
Thanks6232.GenerateChart.zip
Peter
To add to this... I noticed that if I used 19.x version libraries the problem of shifting did not occur. The client is on 15.x, so the suggested fix worked fine for them.
Hello Peter,
Thank you for posting in Infragistics forum.
Can you please try adding HorizontalAlignment setting to the Rectangle object in your marker template and see if it fits your requirement?
-------------------------------- private static DataTemplate GetMarkerTemplate(string color, Presenter viewModel) { DataTemplate template = new DataTemplate(); double heightAndWidth = 7; FrameworkElementFactory gridFactory = new FrameworkElementFactory(typeof(Grid)); FrameworkElementFactory rectangleFactory = new FrameworkElementFactory(typeof(Rectangle)); //Set HorizontalAlignment=Left. rectangleFactory.SetValue(Rectangle.HorizontalAlignmentProperty, HorizontalAlignment.Left);
..... }--------------------------------