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.
/// <summary>
/// Gets or sets the BowMarker X position
/// </summary>
public double BowMarkerXPos
{
get
{
return this.bowMarkerXPos;
}
set
{
this.bowMarkerXPos = value;
this.RaisePropertyChanged("BowMarkerXPos");
}
}
Thanks…
- EJansen asked 11 years ago
- You must login to post comments
Hello Egbert,
Thanks for the inquiry, we’ll look into and get back to you when investigated.
Best regards,
Yuriy
- Yuriy Zadereckiy answered 11 years ago
- You must login to post comments
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
- Yuriy Zadereckiy answered 11 years ago
- You must login to post comments
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?
- Andrew Burnett-Thompson answered 11 years ago
-
Hi Andrew, This works great. Thanks and best regards, Egbert
- You must login to post comments
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
- Andrew Burnett-Thompson answered 11 years ago
- You must login to post comments
Please login first to submit.