Hello,
I am currently using the Blacklight Drag Dock Panel for my web dashboard and am using Telerik RadCharts to display various charts inside of each panel. I have gotten every type of chart to work fine, but can't for the life of me get RadGauges to work. Here is how I create the RadGauge:
public RadGauge AddRadGauge() |
{ |
// create the RadGauge |
var radGauge = new RadGauge() |
{ |
Width = 250, |
Height = 250 |
}; |
// add RadGauge to the LayoutRoot |
LayoutRoot.Children.Add(radGauge); |
// create the RadialGauge |
var gauge = new RadialGauge(); |
// add RadialGauge to the RadGauge |
radGauge.Content = gauge; |
// create the RadialScale |
var scale = new RadialScale() |
{ |
Name = "scale", |
Min = 0, |
Max = 100, |
EndWidth = 0.1, |
StartWidth = 0.1, |
MiddleTicks = 2, |
MinorTicks = 2, |
Radius = 0.75d, |
}; |
// add RadialScale to the RadialGauge |
gauge.Items.Add(scale); |
// create the Needle |
var needle = new Needle() |
{ |
Name = "needle", |
Value = 55 |
}; |
// add needle to indicators collection |
scale.Indicators.Add(needle); |
return radGauge; } |
As you can see I am not doing any data binding or random needle values, I just wanted to get it to show up in my drag dock panel with a default value. This is how I call the AddRadGauge function:
private void AddPanel(int panelIndex) |
{ |
ContentControl temp = new ContentControl(); |
temp = AddRadGauge(); |
string TempHeader = "Radial Gauge"; |
this.panels.Add(new Blacklight.Controls.DragDockPanel() |
{ |
Header = TempHeader, |
Content = temp, |
}); |
} |
I was thinking the problem might be that I am adding the RadGauge as a Child of LayoutRoot and should be adding it to something else... What is the point of adding it to the LayoutRoot? The program compiles and runs but then just freezes on the Silverlight 100% Loading Animation. I am able to create gauges in XAML, but I need them to be a part of the Drag Dock Panel, so I need to write them in C#.
Any questions/suggestions?