Beispiel #1
0
 /// <summary>
 /// 激发事件的函数
 /// </summary>
 protected override void OnClick()
 {
     base.OnClick();
     ReportEventArgs e = new ReportEventArgs(TimeButton.ReportTimeEvent, this);
     e.ClickTime = DateTime.Now;
     this.RaiseEvent(e);
 }
 private void TimeButton_ReportTime(object sender, ReportEventArgs e)
 {
     FrameworkElement fe = sender as FrameworkElement;
     String str = String.Format("{0}到达{1}", e.ClickTime, fe.Name);
     this.listView.Items.Add(str);
     if (fe.Name=="gridB")
     {
         e.Handled = true;
     }
 }