You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@patriksvensson We special case the analyzer to not flag event handler methods that have a special signature:
2 parameters
First parameter is of type object
Second parameter is of type EventArgs or is a sub-type of EventArgs
It seems that your mentioned signature does not meet the criteria in 3. Did you mean to use ListViewItemEventArgs instead of ListViewItem as the second parameter?
Kindly refer to the suggestion 1. in #2593 (comment) - you should rename your parameter with one of the allowed discard symbol names to ensure it is not flagged.
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers
Package Version
Example: v2.9.1
Diagnostic ID
Example: CA1801
Repro steps
I subscribed to an event in XAML (UWP) that generates a event callback in the code-behind file.
Expected behavior
I did not expect to get a warning saying that
sender
is not being used since I cannot remove the parameter without compilation errors.Actual behavior
I get a warning telling me that not all parameters in the event callback is used (
sender
).The text was updated successfully, but these errors were encountered: