Hi,
Could you please tell me how to style the built-in zoombar that comes with the xamDataChart? I have created a custom style that gets applied to XamZoombar controls used outside of the chart and I want this applied to the built-in controls also. Setting all the available styling properties for vertical/horizontal properties i.e. HorizontalScaleLeftStyle, HorizontalScrollLeftStyle etc. seems to set the styles to a degree, but there is clearly some additional styles/templates at work:
Style applied to XamZoombar outside of chart:
Style applied to built-in chart zoombar:
Code to set styles:
chart.HorizontalZoombar.Style = Application.Current.Resources["XamZoombarStyle"] as Style; chart.HorizontalZoombar.HorizontalThumbStyle = Application.Current.Resources["HorizontalThumbStyle"] as Style; chart.HorizontalZoombar.HorizontalScaleLeftStyle = Application.Current.Resources["HorizontalScaleLeftStyle"] as Style; chart.HorizontalZoombar.HorizontalScaleRightStyle = Application.Current.Resources["HorizontalScaleRightStyle"] as Style; chart.HorizontalZoombar.HorizontalScrollLeftStyle = Application.Current.Resources["HorizontalScrollLeftStyle"] as Style; chart.HorizontalZoombar.HorizontalScrollRightStyle = Application.Current.Resources["HorizontalScrollRightStyle"] as Style;
Hello,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
I managed to work round this issue by applying the styles after a short delay (100 milliseconds). Not ideal, but setting the styles on load was inconsistent in my case and would not always produce the desired results:
SmartDispatcher.RunActionAfter(() => { chart.VerticalZoombar.Style = Application.Current.Resources["XamZoombarStyle"] as Style; chart.HorizontalZoombar.Style = Application.Current.Resources["XamZoombarStyle"] as Style; }, TimeSpan.FromMilliseconds(100));
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I created a sample project for you with the functionality you want. Basically I handled the XamDataChart’s Loaded event and get the Vertical and Horizontal Zoombars and set their Style Properties.
Feel free to write me if you have further questions.