You can only override methods in classes that are derived from the original: so unless X1 is derived from Y1 you cannot override it's methods.
public class X1 : Y1
{
protected override int RowCount()
{
return Count;
}
}
public class Y1
{
protected int Count = 666;
protected virtual int RowCount()
{
return -1;
}
}
Will work.