Pre loader

Problem setting a vertical line annotation position in mvvm

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 try to set the position of a vertical line annotation marker in MVVM.

Xaml code looks like this:

<SciChart:SciChartSurface.Annotations>
<SciChart:HorizontalLineAnnotation HorizontalAlignment="Stretch" IsEditable="True" LabelPlacement="Axis" LabelTextFormatting="0.0" ShowLabel="True" Stroke="Orange" StrokeThickness="2" Y1="{Binding Path=UpRightMarkerYPos}" IsHidden="{Binding Path=TimeChartMarkerIsHidden}"/>
<SciChart:VerticalLineAnnotation VerticalAlignment="Stretch" IsEditable="True" LabelPlacement="Axis" LabelTextFormatting="0.0" ShowLabel="True" Stroke="Orange" StrokeThickness="2" X1="{Binding Path=BowMarkerXPos}" IsHidden="{Binding Path=TimeChartMarkerIsHidden}"/>
</SciChart:SciChartSurface.Annotations>

Now I try to set the position of the markers in the viewmodel code.
At startup it takes the correct value.
When changing the marker value in code, it works fine
Now I move the marker with the mouse.
After that, I can not change the position at all in code anymore.

At startup, program hits the get of the BowMarkerXPos property.
After moving the marker with the mouse , the get of the property will not be hit anymore.

    /// &lt;summary&gt;
    /// Gets or sets the BowMarker X position
    /// &lt;/summary&gt;
    public double BowMarkerXPos
    {
        get
        {
            return this.bowMarkerXPos;
        }

        set
        {
            this.bowMarkerXPos = value;
            this.RaisePropertyChanged(&quot;BowMarkerXPos&quot;);
        }
    }

Thanks…

  • You must to post comments
0
0

Please confirm – we’ve tested using a TwoWay binding in our lab and it works (ViewModel property is updated even after dragging the line).

Best regards,
Andrew

  • You must to post comments
0
0

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

  • EJansen
    Hi Andrew, This works great. Thanks and best regards, Egbert
  • You must to post comments
0
0

Hello Egbert,

Thanks for the inquiry, we’ll look into and get back to you when investigated.

Best regards,
Yuriy

  • You must to post comments
0
0

Hi,

We investigated the issue, you can’t deal with annotations in such a way for now. When you move the annotation by dragging it, binding is overridden internally by setting values directly. We try to change this behavior in our next release.

But there is a workaround: you can bind whole AnnotationCollection to ViewModel, create annotations there and also access them directly. So in this case you can set coordinates in VM, and have the same visual output.

Is this workaround suitable for you?

Best regards,
Yuriy

  • You must to post comments
Showing 4 results
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