Fix MouseWheelEventArgs.Delta from static to an instance readonly field#9947
Fix MouseWheelEventArgs.Delta from static to an instance readonly field#9947h3xds1nz wants to merge 2 commits intodotnet:mainfrom
Conversation
That is not such a clear cut, since as discussed in a few other issues here, mouse events/args tend to return the current state of the device rather than the state at the time the args were created. See the buttons state properties, coming from That said, wheel delta is not a state, it's an event, and it seems reasonable that you should be able to accumulate them, and accumulating with the current implementation gives you potentially incorrect results. |
|
Totally forgot; just wanted to say I fully agree with the statement @miloush, was just trying too hard to sell it. |
Description
Similarly as in #7910, the
MouseWheelEventArgs.Deltais a static field, meaning a creation of a new event changes theDeltavalue for all previously created events. This is clearly a bug, the field shall not bestaticbut an instancedreadonlyas the event should describe the state at the exact point of time it was generated.Customer Impact
Creation of a new
MouseWheelEventArgswill not influence the value ofDeltafor previous instances.Regression
No.
Testing
Local build.
Risk
Low.
Microsoft Reviewers: Open in CodeFlow