From 57a42a73ed87ce3bae78e50d104d369c09601d08 Mon Sep 17 00:00:00 2001 From: bricefriha Date: Mon, 13 Jan 2025 11:29:47 +0000 Subject: [PATCH] fix Threading - iOS | fix crash on launch --- App/App.xaml.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/App/App.xaml.cs b/App/App.xaml.cs index 927c06fb..f73d5f67 100644 --- a/App/App.xaml.cs +++ b/App/App.xaml.cs @@ -106,8 +106,11 @@ public void RemoveLoadingIndicator() IsLoading = false; // Close the popup - this.LoadingIndicator.Close(); - } + MainThread.BeginInvokeOnMainThread(() => + { + this.LoadingIndicator.Close(); + }); + } /// /// Function to close the database /// @@ -217,8 +220,10 @@ public void OpenPopUp(Popup popUp, Page page = null) page = GetCurrentPage(); if (page.Navigation.NavigationStack.Any(p => p?.Id == popUp?.Id)) return; - - page.ShowPopup(popUp); + MainThread.BeginInvokeOnMainThread(() => + { + page.ShowPopup(popUp); + }); } catch (Exception ex) {