G
Guest
I have a partial class of a UserControl coded as follows:
public partial class Login : System.Windows.Controls.UserControl
{
public delegate void StartingLoginHandler(string message);
public event StartingLoginHandler StartingLogin;
public Login()
{
InitializeComponent();
}
protected void OnStartingLogin(string message)
{
if (StartingLogin != null)
{
StartingLogin(message);
}
}
}
When I instantiate a UserControl Login() object in the parent page.xaml.cs I
cannot see the event to attach to it. It won't give any Intellisense on the
event and if I just go ahead and type it in like:
oLogin.StartingLogin += oLogin.StartingLoginHandler(delegate_method);
it won't compile; compiler just reports StartingLogin doesn't exist.
What is the solution or a work-around please?
public partial class Login : System.Windows.Controls.UserControl
{
public delegate void StartingLoginHandler(string message);
public event StartingLoginHandler StartingLogin;
public Login()
{
InitializeComponent();
}
protected void OnStartingLogin(string message)
{
if (StartingLogin != null)
{
StartingLogin(message);
}
}
}
When I instantiate a UserControl Login() object in the parent page.xaml.cs I
cannot see the event to attach to it. It won't give any Intellisense on the
event and if I just go ahead and type it in like:
oLogin.StartingLogin += oLogin.StartingLoginHandler(delegate_method);
it won't compile; compiler just reports StartingLogin doesn't exist.
What is the solution or a work-around please?