From f9671bd4cc7e03431c50c9181705e4097517375b Mon Sep 17 00:00:00 2001 From: Takoooooo Date: Tue, 28 Dec 2021 14:31:03 +0200 Subject: [PATCH] use getrequiredservice --- src/Avalonia.Input/TouchDevice.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Avalonia.Input/TouchDevice.cs b/src/Avalonia.Input/TouchDevice.cs index a3881c42e7..84974302eb 100644 --- a/src/Avalonia.Input/TouchDevice.cs +++ b/src/Avalonia.Input/TouchDevice.cs @@ -58,11 +58,8 @@ namespace Avalonia.Input } else { - var settings = AvaloniaLocator.Current.GetService(); - if (settings == null) - { - throw new Exception("ITouchPlatformSettings can not be null."); - } + var settings = AvaloniaLocator.Current.GetRequiredService(); + if (!_lastClickRect.Contains(args.Position) || ev.Timestamp - _lastClickTime > settings.TouchDoubleClickTime.TotalMilliseconds) {