public class A { public int AA; public int AB; public static implicit operator A(B v) { A obj = new A { AA = (A)v.BA, AB = 0 }; return obj; } public static explicit operator B(A v) { B obj = new B { BA = (B)v.AA }; return obj; } } public class B { public int BA; } 

Question: How to make the ObservableCollection<A> type cast to ObservableCollection<B> , if there is no access to an ObservableCollection to change a class?

    1 answer 1

    No You can only create a new collection:

     var colla = new ObservableCollection<A>(...); var collb = new ObservableCollection<B>(colla.Select(a => (B)a));