8,757
社区成员
发帖
与我相关
我的任务
分享
您方便吗,还有一些例子吗? public partial class MainPage : UserControl
{
#region - 内部成员
class 图对象类
{
public delegate void event_handler_moved(Point new_position);
public event event_handler_moved event_moved;
Point _new_position;
///
/// 当位置改变时,改变位置,然后发出消息
///
//if (event_moved!=null) event_moved(_new_position);
public void move_new_position(Point new_position)
{
///
///
}
}
//////////////////////////////////////////////////////////////////////
public 图对象类 graphic1;
public 图对象类 graphic2;
public 图对象类 graphic3;
#endregion
/// <summary>
/// /
/// </summary>
public MainPage()
{
InitializeComponent();
graphic1 = new 图对象类();
graphic1.event_moved += (s) =>
{
graphic2.move_new_position(s);
graphic3.move_new_position(s);
};
graphic2 = new 图对象类();
graphic3 = new 图对象类();
}