How do I get rid of “[some event] never used” compiler warnings in Visual Studio?

前端 未结 7 1537
伪装坚强ぢ
伪装坚强ぢ 2020-12-23 20:08

For example, I get this compiler warning,

The event \'Company.SomeControl.SearchClick\' is never used.

But I know that it\'s use

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-23 20:45

    The compiler is apparently not aware that it's being used in XAML code. Try suppressing the warning in your event definition.

    Also, make sure you're actually raising the event somewhere.

提交回复
热议问题