diff --git a/src/Avalonia.Base/Threading/AvaloniaScheduler.cs b/src/Avalonia.Base/Threading/AvaloniaScheduler.cs index de32057a00..43815b4ebc 100644 --- a/src/Avalonia.Base/Threading/AvaloniaScheduler.cs +++ b/src/Avalonia.Base/Threading/AvaloniaScheduler.cs @@ -26,13 +26,7 @@ namespace Avalonia.Threading /// public override IDisposable Schedule(TState state, TimeSpan dueTime, Func action) { - return DispatcherTimer.Run( - () => - { - action(this, state); - return false; - }, - dueTime); + return DispatcherTimer.RunOnce(() => action(this, state), dueTime); } } } diff --git a/src/Shared/PlatformSupport/StandardRuntimePlatform.cs b/src/Shared/PlatformSupport/StandardRuntimePlatform.cs index e5ede1c6b4..5c02be7d5b 100644 --- a/src/Shared/PlatformSupport/StandardRuntimePlatform.cs +++ b/src/Shared/PlatformSupport/StandardRuntimePlatform.cs @@ -16,10 +16,7 @@ namespace Avalonia.Shared.PlatformSupport public void PostThreadPoolItem(Action cb) => ThreadPool.UnsafeQueueUserWorkItem(_ => cb(), null); public IDisposable StartSystemTimer(TimeSpan interval, Action tick) { - var timer = new Timer(delegate - { - - }, null, interval, interval); + var timer = new Timer(_ => tick(), null, interval, interval); return Disposable.Create(() => timer.Dispose()); }