Here's what I am trying to do:
At the top sits an interface:
interface IHasPosition
{
Position Position
{
get;
}
}
next up, we have an abstract class:
abstract class Person : IHasPosition
{
public abstract Position Position
{
get;
}
}
Finally, I extend Person:
class Instructor : Person
{
public override Position Position
{
get { return new Position(1, 1); }
}
}
This compiles just fine. However, I seem to be unable to explicitly define the property Position. Something like this:
class Instructor : Person
{
public override Position IHasPosition.Position
{
get { return new Position(1, 1); }
}
}
This fails to compile:
Error 1 'ConsoleApplication3.Instructor.IHasPosition.Position': virtual or abstract members cannot be private
Error 3 The modifier 'override' is not valid for this item
Error 2 The modifier 'public' is not valid for this item