Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

Shadowing

Now, what are we to do when the designer of the base class doesn’t mark a method or property, such as CausesValidation, as Overridable? The designer didn’t want us to override that property, but we really have to for the reasons discussed above. Because the property is not Overridable, you simply can’t override it. It’s here you have to again resort to programming subterfuge. By using the keyword Shadows, you completely replace a method or a property of the same name in the base class, and without the permission of the base class designer. By using the Shadows keyword, our class is left with a single implementation of the method—the one we implement. Whereas overriding permits you to modify an existing method in the base class, shadowing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.