I'm having trouble adding a binding to the visibility property of the series definition object programmatically. the binding works fine in xaml, but the object doesn't seem to have a SetBinding() function available to it, only a SetValue() - which doesn't set binding, only the value..
is there another way to do this?
i define a series mapping in XAML but allow users to change the chart type which clears the binding. below is the XAML definition:
And in the C# code-behind i attempt to change the value this way:
there is no SetBinding() function so i'm not sure how i can add the binding alternatively? it can be done perfectly in XAML but not sure about code behind...
Thanks,
Nemanja
is there another way to do this?
i define a series mapping in XAML but allow users to change the chart type which clears the binding. below is the XAML definition:
<rad:SeriesMapping.SeriesDefinition> <rad:BarSeriesDefinition ShowItemLabels="True" ShowItemToolTips="True" ItemLabelFormat="#ProposedSalesQty{#,###,###,##0}" ItemToolTipFormat="#AttributeName, #ProposedSalesQty{#,###,###,##0}" Visibility="{Binding ProposedSalesQtySeriesVisibility}"> <rad:BarSeriesDefinition.Appearance> <rad:SeriesAppearanceSettings Fill="SkyBlue" /> </rad:BarSeriesDefinition.Appearance> </rad:BarSeriesDefinition> </rad:SeriesMapping.SeriesDefinition>And in the C# code-behind i attempt to change the value this way:
((LineSeriesDefinition)MixChart.SeriesMappings[0].SeriesDefinition).SetBinding( LineSeriesDefinition.VisibilityProperty, new Binding("ProposedSalesQtySeriesVisibility"));there is no SetBinding() function so i'm not sure how i can add the binding alternatively? it can be done perfectly in XAML but not sure about code behind...
Thanks,
Nemanja