Skip to content

Fix MouseWheelEventArgs.Delta from static to an instance readonly field #9947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.


using System;

namespace System.Windows.Input
{
/// <summary>
/// The MouseWheelEventArgs describes the state of a Mouse wheel.
/// The <see cref="MouseWheelEventArgs"/> describes the state of a <see cref="Mouse"/> wheel.
/// </summary>
public class MouseWheelEventArgs : MouseEventArgs
{
Expand All @@ -34,7 +31,7 @@ public MouseWheelEventArgs(MouseDevice mouse, int timestamp, int delta) : base(m
/// </summary>
public int Delta
{
get {return _delta;}
get => _delta;
}

/// <summary>
Expand All @@ -49,10 +46,14 @@ public int Delta
/// </param>
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
{
MouseWheelEventHandler handler = (MouseWheelEventHandler) genericHandler;
MouseWheelEventHandler handler = (MouseWheelEventHandler)genericHandler;
handler(genericTarget, this);
}

private static int _delta;
/// <summary>
/// Specifies the delta the mouse wheel has turned.
/// </summary>
private readonly int _delta;

}
}