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
I'm getting a WPF0005 false positive using WpfAnalyzers 2.4.0.
classSelectable:Control{publicstaticreadonlyDependencyPropertyIsSelectedProperty= DependencyProperty.Register(
nameof(IsSelected),typeof(bool),typeof(Selectable),new PropertyMetadata(new PropertyChangedCallback(OnIsSelectedChanged)));publicboolIsSelected{get=>(bool)GetValue(IsSelectedProperty);set=> SetValue(IsSelectedProperty, value);}staticvoidOnIsSelectedChanged(DependencyObjectd,DependencyPropertyChangedEventArgse){varcontrol=(Selectable)d;if((bool)e.NewValue){
control.OnSelected();}else{
control.OnUnseected();}}protectedvirtualvoidOnUnseected()// <-- WPF0005: Method 'OnUnselected' should be named 'OnIsSelectedChanged'{}protectedvirtualvoidOnSelected()// <-- WPF0005: Method 'OnSelected' should be named 'OnIsSelectedChanged'{}}
Extracting 'if' block to another method seems to resolve the issue, so I'm not particularly concerned by it, just thought I should raise the issue in case you wanted to do something about it.
The text was updated successfully, but these errors were encountered:
Ugh, I'm so terrible, thought I fixed this 🙂, thanks for reporting!
Much appreciated that you updated fast and provide fast and awesome feedback, nice to fix while some things are still in memory.
I'm getting a WPF0005 false positive using WpfAnalyzers 2.4.0.
Extracting 'if' block to another method seems to resolve the issue, so I'm not particularly concerned by it, just thought I should raise the issue in case you wanted to do something about it.
The text was updated successfully, but these errors were encountered: