internal ThrottleTimer(int milliseconds, Action handler) { Action = handler; throttleTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds((double)milliseconds) }; throttleTimer.Tick += delegate(object s, EventArgs e) { if (Action != null) { Action.Invoke(); } throttleTimer.Stop(); }; }