Closed janusw closed 1 year ago
I tried to work around it by only modifying the PlotModel instead of assigning a completely new one, but the error still occurs.
It indicates the same PlotModel
is attached to a second PlotView
: can only have one PlotModel
per view, and if you want to 'change' view, you need to assign the Model
of that view to null
or some other PlotModel
before assigning the Model
of the view to which you want to reassign the PlotModel
(so that the PlotModel
is informed that it is no longer attached to the old view)
It indicates the same
PlotModel
is attached to a secondPlotView
Well, in fact I'm only using a single PlotView. So either this view is somehow destroyed and re-created under certain conditions, or some other weird thing is going on (as mentioned, the same code works fine on all other platforms). I'll need to look into this a bit deeper, I guess ...
I've seen users having issues with virtualisation in the past; maybe there's a difference there?
I've seen users having issues with virtualisation in the past; maybe there's a difference there?
Hm, not sure what exactly you mean here. I'm not using any kind of virtualization.
Btw this issue seems to be somewhat related to https://github.com/oxyplot/oxyplot/issues/497
In PR #140, I tried to override the PlotView.Dispose
method on Mac (and dispose the Model there, as suggested in https://github.com/oxyplot/oxyplot/issues/497#issuecomment-129793018), but unfortunately that doesn't seem to help (I still get the same InvalidOperationExceptions).
I have a Xamarin.Forms app that runs well on Android, iOS and UWP. When running on MacOS, however, I get errors when updating the plot (by re-assigning the PlotModel):
This happens both with 2.0.0-beta.1 and 2.0.0-beta.2