Hi,
I'm currently struggeling with the visibility property of a StackedFragmentSeries which is used in a StackedColumnSeries and bound to a dependency-property of the control where the xamDataChart is placed in:
<ig:StackedColumnSeries.Series > <ig:StackedFragmentSeries ValueMemberPath="Value" Visibility="{Binding RelativeSource= {RelativeSource FindAncestor, AncestorType={x:Type local:GridDataLinker}}, Path=IsManualDatasourceSelected, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</ig:StackedColumnSeries.Series></ig:StackedColumnSeries>
The problem is, that the binding can't find the specified ancestor of my control-type if it's specified in the 'ig:StackedFragmentSeries'-Tag as shown above.If I'm moving the the Visibility-Binding to the 'ig:StackedColumnSeries.Series'-Tag its working like charm. But my goal, to collapse specific 'sandwich'-parts of the stacked column can't be reached that way.
Do you have any idea why my binding isn't working?
Thanks in advanced,Joachim
Hello Joachim,
Thank you for your post.
The reason why your bindings are not working is because the StackedFragmentSeries are not visual elements. That is to say, they are not in the same visual tree as the rest of the XamDataChart. I would recommend that you keep the properties that you wish to bind the visibility of these StackedFragmentSeries in your ViewModel which you have bound to your chart. If you keep an instance of your ViewModel defined in the Resources of the Window, then you can access those properties by using a StaticResource binding to that ViewModel and targeting the property as the binding's path.
I have attached a sample application to demonstrate the above. One thing to note is that the fragments that are rendered in the StackedColumnSeries are separate elements, so if you hide one, the series will appear fragmented, and the columns will not be attached to one another.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Ok, thank you for your reply and the attached sample. Finally this seems a valid and working solution to me!
Thanks again and kind regards,Joachim