This is a migrated thread and some comments may be shown as answers.

[Solved] Binding not working for "Stroke"?

3 Answers 117 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Erez
Top achievements
Rank 2
Erez asked on 31 Mar 2014, 06:19 PM
Hi,

I'm creating a dynamic chart using the SeriesProvider and required that each series will be displayed with different color.
Therefore, I created a CategoricalSeriesDescriptor for a LineSeries and tried to bind the Stroke property to a Brush value coming from the model.

After many failed test I found that even if I set the binding to some bogus name, the BindingFailed event is not being called, thus Binding does not even occur. Setting the value to a "real" color (not bound) works.

Could please assist?

                <telerikChart:RadCartesianChart.SeriesProvider >
                    <telerikChart:ChartSeriesProvider Source="{Binding Trends}" x:Name="provider" >
                        <telerikChart:ChartSeriesProvider.SeriesDescriptors >
                            <telerikChart:CategoricalSeriesDescriptor ItemsSourcePath="Items" ValuePath="Value" CategoryPath="DateTime">
                                <telerikChart:CategoricalSeriesDescriptor.Style>
                                    <Style TargetType="telerikChart:LineSeries">
                                        <Setter Property="Stroke" Value="{Binding SeriesStroke}"/>
                                    </Style>
                                </telerikChart:CategoricalSeriesDescriptor.Style>
                            </telerikChart:CategoricalSeriesDescriptor>
                        </telerikChart:ChartSeriesProvider.SeriesDescriptors>
                    </telerikChart:ChartSeriesProvider>
                </telerikChart:RadCartesianChart.SeriesProvider>

Thank you,
Erez

3 Answers, 1 is accepted

Sort by
0
Erez
Top achievements
Rank 2
answered on 31 Mar 2014, 06:46 PM
Update: I solve it by creating a custom descriptor class, but it's far from elegant. 
I would prefer to use binding, if possible.

Thanks,
Erez
0
Accepted
Ivaylo Gergov
Telerik team
answered on 03 Apr 2014, 08:54 AM
Hello,

Unfortunately binding in setter is not supported in WinRT.

Let me know should you have any other questions.

Regards,
Ivaylo Gergov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Erez
Top achievements
Rank 2
answered on 03 Apr 2014, 02:56 PM
Thank you.

I missed that one...

Tags
Chart for XAML
Asked by
Erez
Top achievements
Rank 2
Answers by
Erez
Top achievements
Rank 2
Ivaylo Gergov
Telerik team
Share this question
or