{"action":"created","issue":{"url":"https://api.github.com/repos/oxyplot/oxyplot/issues/497","labels_url":"https://api.github.com/repos/oxyplot/oxyplot/issues/497/labels{/name}","comments_url":"https://api.github.com/repos/oxyplot/oxyplot/issues/497/comments","events_url":"https://api.github.com/repos/oxyplot/oxyplot/issues/497/events","html_url":"https://github.com/oxyplot/oxyplot/issues/497","id":82777543,"number":497,"title":"This PlotModel is already in use by some other PlotView control.","user":{"login":"sunwayking","id":8485400,"avatar_url":"https://avatars.githubusercontent.com/u/8485400?v=3","gravatar_id":"","url":"https://api.github.com/users/sunwayking","html_url":"https://github.com/sunwayking","followers_url":"https://api.github.com/users/sunwayking/followers","following_url":"https://api.github.com/users/sunwayking/following{/other_user}","gists_url":"https://api.github.com/users/sunwayking/gists{/gist_id}","starred_url":"https://api.github.com/users/sunwayking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunwayking/subscriptions","organizations_url":"https://api.github.com/users/sunwayking/orgs","repos_url":"https://api.github.com/users/sunwayking/repos","events_url":"https://api.github.com/users/sunwayking/events{/privacy}","received_events_url":"https://api.github.com/users/sunwayking/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/oxyplot/oxyplot/labels/Android","name":"Android","color":"fbca04"},{"url":"https://api.github.com/repos/oxyplot/oxyplot/labels/iOS","name":"iOS","color":"fbca04"},{"url":"https://api.github.com/repos/oxyplot/oxyplot/labels/plot-model","name":"plot-model","color":"bfe5bf"},{"url":"https://api.github.com/repos/oxyplot/oxyplot/labels/unconfirmed-bug","name":"unconfirmed-bug","color":"e11d21"},{"url":"https://api.github.com/repos/oxyplot/oxyplot/labels/Xamarin.Forms","name":"Xamarin.Forms","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/oxyplot/oxyplot/milestones/1","html_url":"https://github.com/oxyplot/oxyplot/milestones/v1.0","labels_url":"https://api.github.com/repos/oxyplot/oxyplot/milestones/1/labels","id":924312,"number":1,"title":"v1.0","description":"fix issues, update change log, test all examples on all platforms, test all NuGet packages","creator":{"login":"objorke","id":439716,"avatar_url":"https://avatars.githubusercontent.com/u/439716?v=3","gravatar_id":"","url":"https://api.github.com/users/objorke","html_url":"https://github.com/objorke","followers_url":"https://api.github.com/users/objorke/followers","following_url":"https://api.github.com/users/objorke/following{/other_user}","gists_url":"https://api.github.com/users/objorke/gists{/gist_id}","starred_url":"https://api.github.com/users/objorke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objorke/subscriptions","organizations_url":"https://api.github.com/users/objorke/orgs","repos_url":"https://api.github.com/users/objorke/repos","events_url":"https://api.github.com/users/objorke/events{/privacy}","received_events_url":"https://api.github.com/users/objorke/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":44,"state":"open","created_at":"2015-01-06T19:21:04Z","updated_at":"2015-10-20T08:33:01Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2015-05-30T10:51:36Z","updated_at":"2015-10-20T20:20:04Z","closed_at":null,"body":"This issue occures at line 165 in PlotViewEx.cs.\r\nAs my thought, reattaching same plotmodel to the same plotview should not throw this InvalidOperationException showing on title.\r\nThen a possible solution is to avoid throwing InvalidOperationException and reattaching plotmodel when this.currentModel.PlotView equals current plotview object(this).\r\n\r\nCode modification is here:\r\n\r\n```C#\r\nprivate void OnModelChanged()\r\n{\r\n    lock (this.modelLock)\r\n    {\r\n        if (this.currentModel != null)\r\n        {\r\n            ((IPlotModel)this.currentModel).AttachPlotView(null);\r\n        }\r\n\r\n        this.currentModel = this.Model;\r\n\r\n        if (this.currentModel != null && !Equals(this.currentModel.PlotView, this))\r\n        {\r\n            if (this.currentModel.PlotView != null)\r\n            {\r\n                throw new InvalidOperationException(\r\n                    \"This PlotModel is already in use by some other PlotView control.\");\r\n            }\r\n\r\n            ((IPlotModel)this.ActualModel).AttachPlotView(this);\r\n        }\r\n    }\r\n\r\n    this.InvalidatePlot();\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/oxyplot/oxyplot/issues/comments/149690764","html_url":"https://github.com/oxyplot/oxyplot/issues/497#issuecomment-149690764","issue_url":"https://api.github.com/repos/oxyplot/oxyplot/issues/497","id":149690764,"user":{"login":"objorke","id":439716,"avatar_url":"https://avatars.githubusercontent.com/u/439716?v=3","gravatar_id":"","url":"https://api.github.com/users/objorke","html_url":"https://github.com/objorke","followers_url":"https://api.github.com/users/objorke/followers","following_url":"https://api.github.com/users/objorke/following{/other_user}","gists_url":"https://api.github.com/users/objorke/gists{/gist_id}","starred_url":"https://api.github.com/users/objorke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objorke/subscriptions","organizations_url":"https://api.github.com/users/objorke/orgs","repos_url":"https://api.github.com/users/objorke/repos","events_url":"https://api.github.com/users/objorke/events{/privacy}","received_events_url":"https://api.github.com/users/objorke/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T20:20:04Z","updated_at":"2015-10-20T20:20:04Z","body":"The ItemTemplate demos works on all Xamarin Forms platforms.\r\nCan we close this issue?"}}