We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dynamically adding new circular pointers on the fly

How would one dynamically add new circular pointers?

I've noticed that the pointers property is not a dependency property thus I'm unable to bind it.

I tried:
public void RefreshPointers()
{
//clear existing pointers
gaugeScale.Pointers.Clear();
CircularPointer newPointer;
int counter = 0;

foreach (NodeFaceItem item in
NodeContext.ActiveNodeFace.NodeFaceItems)
{
newPointer = new CircularPointer();
newPointer.BorderWidth = 0.3;
newPointer.PointerLength = 66;
newPointer.EnablePointerInteraction = false;
newPointer.PointerWidth = 5;
Binding valueBinding = new Binding("SafeValue");
valueBinding.Source = item;

newPointer.SetBinding(
CircularPointer.ValueProperty,
valueBinding);
newPointer.Value = item.SafeValue;
newPointer.PointerNeedleType =
PointerNeedleType.Marker;
newPointer.PointerPlacement =
ScalePlacement.Inside;
newPointer.BackgroundBrush =
_itemBrushes[counter % _itemBrushes.Length];
newPointer.Visibility = Visibility.Visible;
newPointer.Name = "p" + counter.ToString();
gaugeScale.Pointers.Add(newPointer);
counter++;
}
//gaugeScale.InvalidateVisual();
}

I even tried InvalidateVisual, but sometimes that throws an exception from the Refresh angle method that is hidden from me.

1 Reply

GK Ganesh Kanna S Syncfusion Team February 24, 2010 09:11 AM UTC

Hi HeetendraGowin,

Thanks for your interest in Syncfusion products.

We are able to reproduce the issue mentioned by you. While adding the pointers dynamically ,its added in the collection whereas visual is not updated. We have logged a defect issue for the same and it will be fixed in a week’s time. We will update you with custom assemblies once the issue is fixed.
Please let us know if you have any queries.

Thanks,
Ganesh Kanna S

Loader.
Live Chat Icon For mobile
Up arrow icon