Search code examples
c#subclassperspectivecamera

Can't access to properties of superclass in C#


I'm new in C#, actually I'm creating a subclass of a PerspectiveCamera

class VCamera : PerspectiveCamera
{

    private double m_AngleRadianX;
    private double m_AngleRadianZ;

    public VCamera()
    {
        m_AngleRadianX = 0.0;
        m_AngleRadianZ = 0.0;
        LookDirection = new Vector3D();          
    }
}

My problem is that I can't access to LookDirection, which is a public property of PerspectiveCamera. http://msdn.microsoft.com/en-US/library/system.windows.media.media3d.perspectivecamera.aspx

Is it because LookDirection is inherited from ProjectionCamera!? I don't get it...

Thanks in advance.


Solution

  • It's because PerspectiveCamera is sealed - you can't derive from it. VS doesn't give a very helpful error until you compile.