WPF控件模拟双击事件

          Action a = () =>
            {
                i += 1;
                var timer = new System.Timers.Timer(800) { Interval = 600 };

               timer.Elapsed += (sender, e) =>
                {
                   timer.Enabled = false;
                    i = 0;
                };
                timer.Enabled = true;
                if (i % 2 == 0)
                {
                    i=0;
                    timer.Enabled = false;
                  //你的代码
                }
            };
            name_headChatWin.Dispatcher.Invoke(a);                                    

 

posted @ 2014-06-26 15:14  b̶i̶n̶g̶.̶  阅读(476)  评论(0编辑  收藏  举报