Hello,
I am having some trouble binding a radAreaSparkLine to an ObseravbleCollection of dictionaries. I am trying to use a radTimeBar using the getting started1 video. The code I have is below. When I run parseResourceFile, the resourceItems collection is populated. However, when I create the radAreaSparkLine, no areaPoints are created, are nothing shows up in the timeBar. Does it look like I am doing anything incorrectly?
Thanks,
Eric
I am having some trouble binding a radAreaSparkLine to an ObseravbleCollection of dictionaries. I am trying to use a radTimeBar using the getting started1 video. The code I have is below. When I run parseResourceFile, the resourceItems collection is populated. However, when I create the radAreaSparkLine, no areaPoints are created, are nothing shows up in the timeBar. Does it look like I am doing anything incorrectly?
Thanks,
Eric
<
telerik:RadTimeBar
Grid.Row
=
"2"
x:Name
=
"radTimeBar"
>
<
telerik:RadTimeBar.Intervals
>
<
telerik:HourInterval
/>
<
telerik:MinuteInterval
/>
<
telerik:SecondInterval
/>
<
telerik:MillisecondInterval
/>
</
telerik:RadTimeBar.Intervals
>
</
telerik:RadTimeBar
>
class
ResourceItem
{
public
Dictionary<
int
,
double
> NumericalResourceValues
{
get
{
return
numericalResourceValues ?? (numericalResourceValues =
new
Dictionary<
int
,
double
>()); }
}
public
Dictionary<
int
,
double
> numericalResourceValues;
}
class
Resource
{
public
ObservableCollection<ResourceItem> ResourceItems {
get
;
set
; }
}
void populateTimeBar()
{
int
startTimeColumnIndex = 1;
int
dataColumnIndex = 1;
var resourceParser =
new
ResourceParser();
Resource resource = resourceParser.PaserResourceFile(Constants.LogFilePath);
var rasl =
new
RadAreaSparkline
{
ItemsSource = resource.ResourceItems,
XValuePath =
"NumericalResourceValues["
+ startTimeColumnIndex +
"]"
,
YValuePath =
"NumericalResourceValues["
+ dataColumnIndex +
"]"
};
this
.radTimeBar.Content = rasl;
this
.radTimeBar.DataContext = resource.ResourceItems;
}