Hi
I am using latest version, and I found a problem about data binding Min and Max in GaugeRange.
Xaml like this.
<Window x:Class="TelerikChartTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow"
Height="350"
Width="525">
<Window.Resources>
</Window.Resources>
<Grid>
<telerik:RadRadialGauge x:Name="radialGauge"
Width="200"
Height="200"
telerik:StyleManager.Theme="Windows8">
<telerik:RadialScale Name="scale"
LabelRotationMode="None"
Min="{Binding Path=Min}"
Max="{Binding Path=Max}"
StartWidth="0.1"
EndWidth="0.1"
MajorTicks="4">
<telerik:RadialScale.Ranges>
<telerik:GaugeRange x:Name="range1"
Min="{Binding ElementName=radialGauge, Path=DataContext.Min1, NotifyOnTargetUpdated=True}"
Max="{Binding ElementName=radialGauge, Path=DataContext.Max1, NotifyOnTargetUpdated=True}"
Background="#FF1E8D00" />
</telerik:RadialScale.Ranges>
</telerik:RadialScale>
</telerik:RadRadialGauge>
</Grid>
</Window>
in cs file like this,
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.Loaded += MainWindow_Loaded;
}
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
this.DataContext = new TestData();
}
}
public class TestData : ViewModelBase
{
private float _min = 0;
public float Min
{
get { return _min; }
set
{
_min = value;
this.OnPropertyChanged("Min");
}
}
private float _min1 = 0;
public float Min1
{
get { return _min1; }
set
{
_min1 = value;
this.OnPropertyChanged("Min1");
}
}
private float _max = 1000;
public float Max
{
get { return _max; }
set
{
_max = value;
this.OnPropertyChanged("Max");
}
}
private float _max1 = 1000;
public float Max1
{
get { return _max1; }
set
{
_max1 = value;
this.OnPropertyChanged("Max1");
}
}
}
if I set the DataConxtext in MainWindow_Loaded event, the display of GaugeRange will be mess. I found if we do not set max and min value before loaded event, the display will be wrong, but in some case, the min and max value maybe get updated after loaded event, how can we handle it?