Custom equality comparer for WPF ComboBox Custom equality comparer for WPF ComboBox wpf wpf

Custom equality comparer for WPF ComboBox


The reason I don't want to modify the method directly is because the class is also used for business logic and I don't want my equality comparer to affect other things that use the same class

This usually indicates a wrapper that is needed:

public class Wrapper<T>{    public override string ToString() { ... }    public override bool Equals(object obj) { ... }    public T UnderlyingRecord { get; set; }}

This way you can carry on as normal and only the view will use the wrapper object.