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

Databind a linear gauges indicators

2 Answers 63 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Johan
Top achievements
Rank 1
Johan asked on 21 Nov 2012, 07:40 PM
Hi!
I have created a Linear Gauge in my WP app by using the Smart Tag.
This results in some of the xaml I pasted in below.
How can I databind the three places where the value is hardcoded to 27.67?
I have tried to bind them to an existing value  in my viewmodel,  {Binding MyViewModelValue} , but the result is 0,0 regardless my viewmodel value when running the app.
TIA
/Johan
<gauges:RadGauge Margin="0,92,0,0">
...
  <gauges:LinearBarGaugeIndicator x:Name="indicator1" BarBrush="{StaticResource PhoneForegroundBrush}" BarThickness="8" IsAnimated="True" RenderTransform="{StaticResource indicatorNudge}" Value="27.67"/>
  <gauges:MarkerGaugeIndicator x:Name="indicator2" IsAnimated="True" gauges:LinearGaugeRange.IndicatorOffset="7" Value="27.67">
...
<gauges:MarkerGaugeIndicator x:Name="indicator3" IsAnimated="True" gauges:LinearGaugeRange.IndicatorOffset="12" Value="27.67">

2 Answers, 1 is accepted

Sort by
0
Accepted
Victor
Telerik team
answered on 22 Nov 2012, 08:20 AM
Hello Johan,

Thanks for writing.
Please verify that your view model implements the INotifyPropertyChanged interface. Also please verify that the data context of your chart is your view model. If the interface is implemented and the data context is correct, please write again so that I can assist you further.

I am looking forward to your reply.

Kind regards,
Victor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Johan
Top achievements
Rank 1
answered on 22 Nov 2012, 09:12 AM
Lesson learned; don't refactor code while watching UEFA Champions League on tv.
I kind of removed the call to the method setting the actual gauge values.

The databinding works perfectly.
Thnx Victor.

/Johan 
Tags
Gauge
Asked by
Johan
Top achievements
Rank 1
Answers by
Victor
Telerik team
Johan
Top achievements
Rank 1
Share this question
or