Hi Experts,
recently i'm trying to do some event handle to manage my
application, the major purpose is, once my main form method get
calling, i need the rest of my sub instance user control function also
need to be trigger and doing the following action, i believe event
handling is the direction.
i have read some article and sample, but my code since still cannot
work, i need some expert to spend some little time to help to this,
billion thanks:
my problem is : 1) how to share the same action 2) i dont know where
to fire for the action.
code below:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
namespace WpfApplication3
{
public class Class3
{
public delegate void MyEventHandler ( object o, EventArgs e );
public event MyEventHandler MyEventHandler_1;
public event MyEventHandler MyEventHandler_2;
}
public class MyClass1
{
public Class3 x = new Class3();
public void MyClass1_()
{
x.MyEventHandler_1 += new
Class3.MyEventHandler(OnMyEventHandler_1);
x.MyEventHandler_2 += new
Class3.MyEventHandler(OnMyEventHandler_2);
}
public void OnMyEventHandler_1( object o , EventArgs e )
{
MessageBox.Show("called OnMyEventHandler_1");
}
public void OnMyEventHandler_2(object o, EventArgs e)
{
MessageBox.Show("called OnMyEventHandler_2");
}
}
}