Hi there
Is it possible to display VisibleMinimum and VisibleMaximum while the user drags left or right Zoombar slider similar to a feature found in XamDataGrid? Can it be done in xaml without using code behind?
Thank you
Boris
Hello Boris,
Excuse me for the late reply, I have been looking into your requirement for quite some time and it proved harder than I anticipated. Since there is no built-in functionality to provide that, I had to come up with a custom approach. I have managed to achieve the functionality you desire by adding a couple of TextBlocks to the XamZoombar’s original template and binding them to the protected PreviewRect proeprty of the XamDataChart. Alas I had do a simple calculation inside a IMultiValueConverter I created for the job and the result is the DataChart_thumb_tip.zip sample project I created for you. I should point out that this will only work when using the latest Service Release, since I take advantage of a fixed issue in the source code, in order to be able to provide the functionality only by using xaml.
Please let me know, if you require any further clarification regarding this approach.
Thank you very much Petar. I think it’s a useful feature and as such could be a good candidate for built in functionality in the future releases. There is a minor problem thou - it does not seem to work. Probably the service release that you are referring to has not been distributed yet. I have run platform installer today and the referenced assemblies have version 12.1.20121.2002. I think this version has been out for a month or so. Could you please check assy versions at your side?
Thanks a lot
I ivestigated a bit further. I can see the following:
MultiValueConverter Convert is called initially with values[0] set to + or - Infinity.
Visibility triggers work
Text box positions are set correctly
MultiValueConverter Convert is not called when the user moves HorizontalScale Left, Right or Thumb elements. as if PreviewRect Left or Right values are not changing.
Any ideas?
Hi Boris,
I am just checking, if you require any further assistance on the matter.
Thanks for the correction, I had concentrated on figuring out the binding and must have missed this particular case scenario.
Besides that, I am really glad to hear you are happy with the solution.
Small correction - in VisibleValuesConverter class, Convert method the line that returns formatted value should read like this:
return (axis.ActualMinimumValue + (axis.ActualMaximumValue - axis.ActualMinimumValue) * (double)values[0]).ToString("N2");
Otherwise the calculations are off mark for non Zero-based X Axis
Thank you Petar. It works great now