Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
StackedFragmentSeries Visibility-Binding not working
posted

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

Parents
  • 34810
    Verified Answer
    Offline posted

    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,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XamDataChartStackSeriesVisCase.zip
Reply Children
No Data