From 74873081c6a4d78e3b862cec5f9ec75690bfc7a6 Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 12 Dec 2024 20:02:12 +0300 Subject: [PATCH 1/4] Add scrolling logic to DefaultDialogService --- src/UraniumUI/Dialogs/DefaultDialogService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UraniumUI/Dialogs/DefaultDialogService.cs b/src/UraniumUI/Dialogs/DefaultDialogService.cs index 16af6c16..cec6c580 100644 --- a/src/UraniumUI/Dialogs/DefaultDialogService.cs +++ b/src/UraniumUI/Dialogs/DefaultDialogService.cs @@ -424,12 +424,12 @@ public Task DisplayFormViewAsync(string title, TViewMode var popupPage = new DefaultDialogAnimatedContentPage { BackgroundColor = GetBackdropColor(), - Content = GetFrame(Page.Width, new ScrollView + Content = GetFrame(Page.Width, new VerticalStackLayout { Children = { GetHeader(title), - new VerticalStackLayout { Content = formView }, + new ScrollView { Content = formView, MaximumHeightRequest = Page.Height * .8 }, GetDivider(), GetFooter(new Dictionary { From 5be57d96ddf10f52b27bcd3867efb06f477f0c50 Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 12 Dec 2024 20:02:25 +0300 Subject: [PATCH 2/4] Disable animation for DefaultDialogAnimatedContentPage --- src/UraniumUI/Dialogs/DefaultDialogAnimatedContentPage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UraniumUI/Dialogs/DefaultDialogAnimatedContentPage.cs b/src/UraniumUI/Dialogs/DefaultDialogAnimatedContentPage.cs index e8da513c..63c4668d 100644 --- a/src/UraniumUI/Dialogs/DefaultDialogAnimatedContentPage.cs +++ b/src/UraniumUI/Dialogs/DefaultDialogAnimatedContentPage.cs @@ -37,6 +37,6 @@ public async Task CloseAsync() await Task.WhenAll(tasks); - await Navigation.PopModalAsync(); + await Navigation.PopModalAsync(animated: false); } } From c40b9738ed3dbda949f10c4147ba1efb9ac2dc3f Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 12 Dec 2024 20:19:20 +0300 Subject: [PATCH 3/4] Add scrolling logic to MopupsDialogService --- src/UraniumUI.Dialogs.Mopups/MopupsDialogService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UraniumUI.Dialogs.Mopups/MopupsDialogService.cs b/src/UraniumUI.Dialogs.Mopups/MopupsDialogService.cs index 9d1a201f..9f37268b 100644 --- a/src/UraniumUI.Dialogs.Mopups/MopupsDialogService.cs +++ b/src/UraniumUI.Dialogs.Mopups/MopupsDialogService.cs @@ -371,7 +371,7 @@ public Task DisplayFormViewAsync(string title, TViewMode Children = { GetHeader(title), - formView, + new ScrollView { Content = formView, MaximumHeightRequest = Page.Height * .8 }, GetDivider(), GetFooter( new Dictionary { From 2079fdf8ead532a320f5fe65712964a7401dab80 Mon Sep 17 00:00:00 2001 From: enisn Date: Thu, 12 Dec 2024 20:21:19 +0300 Subject: [PATCH 4/4] Prevent exceptions when completed twice --- .../CommunityToolkitDialogService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UraniumUI.Dialogs.CommunityToolkit/CommunityToolkitDialogService.cs b/src/UraniumUI.Dialogs.CommunityToolkit/CommunityToolkitDialogService.cs index eb27ac54..a350d815 100644 --- a/src/UraniumUI.Dialogs.CommunityToolkit/CommunityToolkitDialogService.cs +++ b/src/UraniumUI.Dialogs.CommunityToolkit/CommunityToolkitDialogService.cs @@ -531,12 +531,12 @@ public Task DisplayFormViewAsync(string title, TViewMode { { submit, new Command(() => { - tcs.SetResult(viewModel); + tcs.TrySetResult(viewModel); popup.Close(); }) }, { cancel, new Command(() => { - tcs.SetResult(null); + tcs.TrySetResult(null); }) } });