-
Notifications
You must be signed in to change notification settings - Fork 980
Description
Imported from http://oxyplot.codeplex.com/workitem/10132
objo 2014-02-17 08:08
We can achieve the same functionality by using a PlotController
https://oxyplot.codeplex.com/workitem/9625
- Better separation of controller logic and model
- Less code
- Better performance of PlotController
objo 2014-03-19 22:57
It seems to be quite convenient to use the events. Or is that valid only for the simple demos?
objo 2014-03-21 09:02
An alternative could be to add an EnableMouseEventsInModel property on the
PlotController. The default value could be false. When the value is false, the mouse events should not be raised on the
PlotModel and PlotElements.
tibel 2014-04-12 08:43
Hmm, still don't like it. The PlotModel and its child elements should not know anything about a mouse, keyboard or touch. Also it is easy to create memory leaks by events on child elements of the PlotModel when your plot is more dynamic (e.g. adding and
removing annotations).
Therefore I would prefer following:
- mouse/keyboard events exist only on
PlotControllerand the event will tell you what element of the plot was e.g. clicked - similar the
AxisChangedshould be onPlotModeland tell you what axis changed - Ultimately no child element of the plotmodel should expose any events
With this approach I don't have problems with adding/removing elements from the plotmodel and my event handlers.