Pre loader

Custom Annotation - Path Data binding

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

I have a custom annotation class that I would like to bind the geometries.

<Path.Data>

</Path.Data>

    public GeometryGroup Elements
    {
        get { return _elements; }
        set
        {
            _elements = value;
            InvokePropertyChanged("Elements");
        }
    }

When I create the class in code it only works if Path was set in xaml, doesn’t work if set in code.

            Path p = new Path();
            p.Data = Geometry.Parse("m 0 0 10 0 10 10 0 10 z");             
            GeometryGroup g = new GeometryGroup();
            g.Children.Add(p.RenderedGeometry);
            CustomPathAnnotation cpa = new CustomPathAnnotation()
            {
                Elements = g,
                X1 = .55,
                Y1 = .5, 
                CoordinateMode = AnnotationCoordinateMode.Relative,
                XAxisId = "DefaultAxisId",
                YAxisId = "DefaultAxisId",
                Visibility = Visibility.Visible
            };
            ChartAnnotation.Add(cpa);
Version
4.0
  • Yuriy Zadereckiy
    Hi Dan, I’m not sure why it doesn’t work, there shouldn’t be any diference between setting a property in XAML or in code. Could you post the full code of your custom annotation class here for us to take a look?
  • You must to post comments
0
0

Yuriy,

I got it to work using the following:

    <Polygon x:Name="ptPolygon" Points="{Binding polyPoints}" Stretch="Fill" Fill="{Binding polyFill}" Stroke="{Binding polyStroke}" />
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies