diff --git a/Xamarin.Forms.Platform.GTK/GtkPlatformServices.cs b/Xamarin.Forms.Platform.GTK/GtkPlatformServices.cs index 77b955ecab2..547e460e076 100644 --- a/Xamarin.Forms.Platform.GTK/GtkPlatformServices.cs +++ b/Xamarin.Forms.Platform.GTK/GtkPlatformServices.cs @@ -93,19 +93,11 @@ public void OpenUriAction(Uri uri) public void StartTimer(TimeSpan interval, Func callback) { - var timer = new System.Timers.Timer(interval.TotalMilliseconds); - - timer.Elapsed += (sender, args) => + GLib.Timeout.Add((uint)interval.TotalMilliseconds, () => { var result = callback(); - - if (!result) - { - timer.Stop(); - } - }; - - timer.Start(); + return result; + }); } private static int Hex(int v) diff --git a/Xamarin.Forms.Platform.GTK/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.GTK/Renderers/LabelRenderer.cs index b55c0c4ce97..6709c296359 100644 --- a/Xamarin.Forms.Platform.GTK/Renderers/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.GTK/Renderers/LabelRenderer.cs @@ -72,10 +72,7 @@ private void UpdateText() if (formatted != null) { - Gtk.Application.Invoke(delegate - { - Control.SetTextFromFormatted(formatted); - }); + Control.SetTextFromFormatted(formatted); } else { @@ -87,10 +84,7 @@ private void UpdateText() Text = Element.Text }; - Gtk.Application.Invoke(delegate - { - Control.SetTextFromSpan(span); - }); + Control.SetTextFromSpan(span); } }