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

Scale XTickProperties Location Binding

1 Answer 37 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 19 Oct 2011, 11:40 PM
Hi,

I am using the 2011 Q2 version.

Here's a simplified xaml code taken from my solution:

<telerik:RadialGauge
    <telerik:RadialScale>                               
        <
telerik:RadialScale.MajorTick>
            <
telerik:MajorTickProperties
             Location
="{Binding Path=MajorTicksLocation, Converter={StaticResource LocationConverter}}" />
        </telerik:RadialScale.MajorTick>                            
        <
telerik:RadialScale.MiddleTick>                               
            <
telerik:MiddleTickProperties
             Location
="{Binding Path=MiddleTicksLocation, Converter={StaticResource LocationConverter}}"/>                              
        </
telerik:RadialScale.MiddleTick>                              
        <
telerik:RadialScale.MinorTick>                                   
            <
telerik:MinorTickProperties
             Location
="{Binding Path=MinorTicksLocation, Converter={StaticResource LocationConverter}}"/>                              
        </
telerik:RadialScale.MinorTick>                         
    </
telerik:RadialScale>                  
</
telerik:RadialGauge>

As you can see I am trying to bind the XTickProperties's Location property. I am also using a converter here.
The problem is that nothing happens when the property in my ViewModel is changed. What's really weird is that
I use Bindings with Converters on properties of other gauge objects (not shown in the code snippet) such as the Size of the gauge and they work. Moreover, I put a breakpoint  in the Convert method of my converter and it is never reached. Please note that I have successfully done this binding before "programatically".

I went over this a few times thinking I had a done a stupid mistake somewhere, but before I waste any more time on it I would like
to confirm with someone that the particular Binding that I'm trying to do is not defective.

Thank you

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 24 Oct 2011, 08:39 AM
Hi Guy,

This problem occurs because in the current version of the RadGauge data context is not propagated to the objects which represent tick properties (MajorTickProperties, MiddleTickPropeties, MinorTickProperties). It will be changed in the upcoming 2011.Q3 release. For the current version I could suggest following work around: set data context to the tick properties objects from the code. For example:

public partial class MainPage : UserControl
{
    private GaugeDataModel dataModel = new GaugeDataModel();
 
    public MainPage()
    {
        InitializeComponent();
 
        this.DataContext = dataModel;
        this.radialScale.MajorTick.DataContext = dataModel;
    }
}


Greetings,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Gauge
Asked by
Guy
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or