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).
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
Please login first to submit.