0
Wird überprüft

Switching PlotModel in RunTIme

mike vor 9 Jahren aktualisiert von Oystein Bjorke vor 9 Jahren 1
Hello,
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?

Thanks,
Mike
Wird überprüft
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!