SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

Hi,

We have the WPF 2D version.

We have bound the VisibleRange on both X and Y axes to our viewmodel.
A combo-box selection triggers the OnPropertyChanged which will assign a default range depending on the type of data we want to display.
We also have allowed for the user to drag the axes and adjust the ranges as desired.

This all works as we’d expect, until the user does a manual adjustment, then the binding to the combo-box seems to be broken (the default ranges we set for the given data no longer update the X and Y axes).

Version
5.2.1.11757
  • You must to post comments
0
0

Hi Geoffrey,

This is a common way of how WPF binding works. If you have setup a binding in XAML, then you set the property value in code, the binding will be overwritten by the property value.

The solution is — if you must set VisibleRange in code, to use TwoWay bindings, and to use the SetCurrentValue method as follows:

  axis.SetCurrentValue(AxisBase.VisibleRangeProperty, new DoubleRange()); // set your new VisibleRange

Best regards
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.