{"action":"created","issue":{"url":"https://api.github.com/repos/oxyplot/oxyplot/issues/917","repository_url":"https://api.github.com/repos/oxyplot/oxyplot","labels_url":"https://api.github.com/repos/oxyplot/oxyplot/issues/917/labels{/name}","comments_url":"https://api.github.com/repos/oxyplot/oxyplot/issues/917/comments","events_url":"https://api.github.com/repos/oxyplot/oxyplot/issues/917/events","html_url":"https://github.com/oxyplot/oxyplot/issues/917","id":158953720,"number":917,"title":"Mouse events - access plotmodel from within the event handler","user":{"login":"riegaz","id":1749401,"avatar_url":"https://avatars.githubusercontent.com/u/1749401?v=3","gravatar_id":"","url":"https://api.github.com/users/riegaz","html_url":"https://github.com/riegaz","followers_url":"https://api.github.com/users/riegaz/followers","following_url":"https://api.github.com/users/riegaz/following{/other_user}","gists_url":"https://api.github.com/users/riegaz/gists{/gist_id}","starred_url":"https://api.github.com/users/riegaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riegaz/subscriptions","organizations_url":"https://api.github.com/users/riegaz/orgs","repos_url":"https://api.github.com/users/riegaz/repos","events_url":"https://api.github.com/users/riegaz/events{/privacy}","received_events_url":"https://api.github.com/users/riegaz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/oxyplot/oxyplot/labels/help-wanted","name":"help-wanted","color":"000000"},{"url":"https://api.github.com/repos/oxyplot/oxyplot/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-07T15:30:34Z","updated_at":"2016-06-08T07:53:49Z","closed_at":null,"body":"Question:\r\n\r\nMouse events provide the plotcontroller as a source. How do I access the plotmodel from within the event handler?\r\n\r\nLets say I want to add an annotation when I click the plotview?\r\n\r\n```\r\nvar model= new PlotModel();\r\nmodel.MouseDown += Model_MouseDown;\r\n\r\nprivate void Model_MouseDown(object sender, OxyMouseDownEventArgs e)\r\n    {\r\n        var controller= sender as PlotController;\r\n        var plot = how to get it?\r\n        plot.Annotations.Add(new Annotation());\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/oxyplot/oxyplot/issues/comments/224515697","html_url":"https://github.com/oxyplot/oxyplot/issues/917#issuecomment-224515697","issue_url":"https://api.github.com/repos/oxyplot/oxyplot/issues/917","id":224515697,"user":{"login":"riegaz","id":1749401,"avatar_url":"https://avatars.githubusercontent.com/u/1749401?v=3","gravatar_id":"","url":"https://api.github.com/users/riegaz","html_url":"https://github.com/riegaz","followers_url":"https://api.github.com/users/riegaz/followers","following_url":"https://api.github.com/users/riegaz/following{/other_user}","gists_url":"https://api.github.com/users/riegaz/gists{/gist_id}","starred_url":"https://api.github.com/users/riegaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riegaz/subscriptions","organizations_url":"https://api.github.com/users/riegaz/orgs","repos_url":"https://api.github.com/users/riegaz/repos","events_url":"https://api.github.com/users/riegaz/events{/privacy}","received_events_url":"https://api.github.com/users/riegaz/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T07:53:49Z","updated_at":"2016-06-08T07:53:49Z","body":"Does the plotcontroller provide any possibility to get its parent element? This would be the plotview then, which would hold the plotmodel. Maybe I do not see a the basic strategy here but mouse events most probably should influence the plotmodel properties or am I wrong?"}}
{"actor":{"display_login":"riegaz"}}