Skip to content

Shadowing

Mario Gutierrez edited this page Jan 7, 2017 · 1 revision

Instead of overriding, you can completely replace (shadow) the parent method, property or field.

public new int MyProperty { get; set; }
public new void MyMethod() { }

You can still access the parent's original member by explicit casting.

((Parent)child).MyMethod();
Clone this wiki locally