Click or drag to resize

Throttle Class

Implements a simple timed throttle.

Calling Tick multiple times will restart the timer; there will be one single call to the action when the delay time has elapsed after the last tick.

Inheritance Hierarchy
SystemObject
  TomsToolbox.WpfThrottle

Namespace: TomsToolbox.Wpf
Assembly: TomsToolbox.Wpf (in TomsToolbox.Wpf.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public class Throttle

The Throttle type exposes the following members.

Constructors
 NameDescription
Public methodThrottle(Action) Initializes a new instance of the Throttle class with a default timeout of 100ms.
Public methodThrottle(TimeSpan, Action) Initializes a new instance of the Throttle class.
Top
Methods
 NameDescription
Public methodTick Ticks this instance to trigger the throttle.
Top
Extension Methods
 NameDescription
Public Extension MethodSafeCastT Performs a cast from object to T, avoiding possible null violations if T is a value type.
(Defined by ObjectExtensions)
Top
See Also