Under review

Switching PlotModel in RunTIme

mike 5 years ago in API updated by Oystein Bjorke 5 years ago 1
After binding to a certain instance of PlotModel I'm trying to switch a plot model in run time.
In other words, I assign a new created PlotModel to the same variable that was used with the UI control. However, the graph control doesn't seems to adjust (and I do call InvalidatePlot(true)).

To be more specific,
<oxy:Plot Model="{Binding Models.MyGraphSwitcher1.MyPlotModel}" />

"MyPlotModel" above is a "OxyPlot.PlotModel" and it is changed by the ViewModel - "MyGraphSwitcher1". The problem is that when "MyPlotModel" is set to point to a new PlotModel instance the UI control is not updated. I believe it has to do with the bindings.

I wonder if there is some way to make this work?

Under review
WPF? Are you implementing INotifyPropertyChanged? Can you provide a simple example project that reproduces the error? Then we can add a bug in the GitHub issues!