Beispiel #1
0
        protected override void OnClick()
        {
            base.OnClick();

            ReportTimeEventArgs args = new ReportTimeEventArgs(ReportTimeEvent, this);

            args.ClickTime = DateTime.Now;
            this.RaiseEvent(args);
        }
Beispiel #2
0
        private void ReportTimeHandler(object sender, ReportTimeEventArgs e)
        {
            FrameworkElement ele     = sender as FrameworkElement;
            string           timeStr = e.ClickTime.ToLongTimeString();
            string           content = $"{timeStr} arrives {ele.Name}";

            this.listbox.Items.Add(content);

            if (ele == this.grid3)
            {
                e.Handled = true;
            }
        }