Binding Winforms Data to Interface Inheritance

I need someone to confirm what I see before I can change the application domain due to this problem. The problem is that when you bind data to interfaces that inherit from each other, you cannot see properties on the underlying interfaces.

I am working on a WinForms application using data binding. This is in .net3.5 and I cannot use wpf.

Anyway, I have a setting like this.

public interface IClassOne
{
    string Prop1 { get; set; }
}

public interface IClassTwo : IClassOne
{
    string Prop2 { get; set; }
}

public abstract class ClassOne : IClassOne
{
    public string Prop1 { get; set; }
}

public class ClassTwo : ClassOne, IClassTwo
{
    public string Prop2 { get; set; }
}

The base class will contain common properties and logic. The base interface will have these common properties, so they must be implemented in each specific implementation.

, IClassTwo. , IClassTwo, Prop1 WinForms. , Prop1, .

, ClassTwo, .

, . IClassTwo, , .

, . , , .

.

+3
1
+1

Source: https://habr.com/ru/post/1734611/


All Articles