DispatcherExtensions.StartTimer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Starts a timer on the specified IDispatcher context.
public:
[System::Runtime::CompilerServices::Extension]
static void StartTimer(Microsoft::Maui::Dispatching::IDispatcher ^ dispatcher, TimeSpan interval, Func<bool> ^ callback);
public static void StartTimer (this Microsoft.Maui.Dispatching.IDispatcher dispatcher, TimeSpan interval, Func<bool> callback);
static member StartTimer : Microsoft.Maui.Dispatching.IDispatcher * TimeSpan * Func<bool> -> unit
<Extension()>
Public Sub StartTimer (dispatcher As IDispatcher, interval As TimeSpan, callback As Func(Of Boolean))
Parameters
- dispatcher
- IDispatcher
The IDispatcher instance this method is called on.
- interval
- TimeSpan
Sets the amount of time between timer ticks.
The callback on which the dispatcher returns when the event is dispatched.
If the result of the callback is true
, the timer will repeat, otherwise the timer stops.
Exceptions
Thrown when callback
is null
.