This PlotModel is already in use by some other PlotView control
See https://github.com/oxyplot/oxyplot/issues/948
I have exactly the same problem :/ i'm currently trying to find a workaround by setting the Model property of the PlotView to null when i leave the tab and create a new instance of the model when I go back to the first tab. Setting the Model property to null makes the crash disapear but now i'm having problems to create the model again... either way this is a awful way to implement this :s more ideas?
So, the only way I found to plot a pie in a tabbed page was to forget the binding in Xaml and do it all in code behind with the plot model in the VM. In code beind I registered to the tab change event and the VM property changed event so that I could set the plot model to null every time I go to the third tab, constructing it again. Its also required to set the Model property of the PlotView to null. It's a awfull way of doing it , but at least it works
I'm having the same issue in Xamarin.Android.
I use a PlotView inside a Fragment (there are 3 Fragments all together inside a tab) , when I slide to the other tabs and then slide back, I have this error.
I think Android is caching fragments and recreating them when sliding back, so the view is re-created and tries to re-bind the model and view.
Edit:
I think I find a solution for my case: I use setOffscreenPageLimit (OffscreenPageLimit in Xamarin) to keep all my fragments in memory, which avoids the re-creation of fragments.
There is another way to reproduce this issue when there are only one Model and one View. When the phone is rotated from portrait to landscape, Android will re-create the view. If MVVM is used, the model has not re-created then this issue arises.
I am also facing the same issue what the work around for that. same as flyingxu commented on Jun 1
I found an easy way to reproduce this issue if needed. Just run the iOS ExampleBrowser and navigate to an example, go back, and then navigate to the SAME example again. Crash!
If you set the parent View of your OxyPlot to a DataTemplate that creates a new OxyPlot each time then the OxyPlot cannot be cached. A new PlotModel and PlotView is created each time and this error is avoided (at least that seems to work for me, I am using CarouselView)