Why can't I access the base class (testClass) properties through it's interface (ItestClass)? I have created the interface to avoid the actual Control (winforms/wpf) properties to be visible in the third class (newClass). if that is not possible is there a better way?
public class testClass : Control, ItestClass
{
public int Property1 { set; get; }
public int Property2 { set; get; }
public testClass() { }
}
public interface ItestClass
{
int Property1 { get; set; }
int Property2 { get; set; }
}
public class newClass : ItestClass
{
public newClass()
{
// Why are the following statements are not possible?
Property1 = 1;
// OR
this.Property1 = 1;
}
}