I have a code:
public class Layout : UserControl
{
protected void DisplayX_DisplayClicked(object sender, DisplayEventArgs e)
{
CurrentDisplay = (CameraPanel)sender;
}
}
'Layout' is a base class for my other layouts. For example, I have a 'Layout1' derived from base class 'Layout'. Layout1 has an element Display01. Display01 has an DisplayClicked event. I'm trying to assign DisplayX_DisplayClicked via Visual Studio Designer to DisplayClicked event of Display01.
public partial class Layout1 : Layout
{
private CameraPanel Display01;
}
It gives me an error:
The method 'xxx' cannot be the method for an event because a class this class derives from already defines the method.
How to use method from base class as a eventhandler of derived class ? Is it possible ? If so, how. If no, why.