Try
class C : I
{
public A TheObject {get;set;}
B I.TheObject
{
get { return A; }
set { A = value as A; }
}
}
You may need to change the installer B, depending on your needs. Implementing an interface in this way has the following consequences. When working with a variable printed as C, you will not be able to access the B object. If you need to, you will need to declare the variable i and assign it to your variable C var. The implementation of I is thus known as the explicit implementation.
eg,
C c = new C();
A a = c.TheObject;
I i = c;
B b = i.TheObject;
source
share