//定义一个你自己的EventArgs,当然,这不是必需的。
public class DatagridEventArgs : EventArgs{
private int mPage;
public DatagridEventArgs(int page){
mPage = page;
}
public int Page{
get{return mPage;}
set{mPage=value;}
}
}
//然后声明一个delegate:
public delegate void DatagridEventHandler(object sender,DatagridEventArgs e);
//然后定义你的event:
public event DatagridEventHandler DataBinded;
//最后定义你的方法:
protected void OnDataBinded(DatagridEventArgs e){
DataBinded(this,e);
}
//在程序代码中这样调用:
DatagridEventArgs e = new DatagridEventArgs(mCurrentPage);
DataBinded(this,e);
public class DatagridEventArgs : EventArgs{
private int mPage;
public DatagridEventArgs(int page){
mPage = page;
}
public int Page{
get{return mPage;}
set{mPage=value;}
}
}
//然后声明一个delegate:
public delegate void DatagridEventHandler(object sender,DatagridEventArgs e);
//然后定义你的event:
public event DatagridEventHandler DataBinded;
//最后定义你的方法:
protected void OnDataBinded(DatagridEventArgs e){
DataBinded(this,e);
}
//在程序代码中这样调用:
DatagridEventArgs e = new DatagridEventArgs(mCurrentPage);
DataBinded(this,e);