From 27e2d98f3f9723057335d4b15f3fd713086d599d Mon Sep 17 00:00:00 2001 From: Fabricio Bertani Date: Sat, 7 Mar 2026 17:45:55 +0100 Subject: [PATCH] Add XML documentation for custom exception classes in Popup and KeyboardExtensions --- .../KeyboardExtensions.shared.cs | 5 ++++- .../Views/Popup/Popup.shared.cs | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.shared.cs b/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.shared.cs index 1ba15696c9..e74f643a4b 100644 --- a/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.shared.cs +++ b/src/CommunityToolkit.Maui.Core/Platform/KeyboardExtensions/KeyboardExtensions.shared.cs @@ -118,7 +118,10 @@ static bool TryGetPlatformView(this ITextInput textInput, return true; } - sealed class SoftKeyboardException(string message) : Exception(message) + /// + /// An thrown when unable to retrieve the platform view to determine soft keyboard status. + /// + public sealed class SoftKeyboardException(string message) : Exception(message) { } } \ No newline at end of file diff --git a/src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs b/src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs index 3601b640c4..9cd80d7072 100644 --- a/src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs +++ b/src/CommunityToolkit.Maui/Views/Popup/Popup.shared.cs @@ -112,8 +112,17 @@ public partial class Popup : Popup public virtual Task CloseAsync(T result, CancellationToken token = default) => GetPopupPage().CloseAsync(new PopupResult(result, false), token); } -sealed class PopupNotFoundException() : InvalidPopupOperationException($"Unable to close popup: could not locate {nameof(PopupPage)}. {nameof(PopupExtensions.ShowPopup)} or {nameof(PopupExtensions.ShowPopupAsync)} must be called before {nameof(Popup.CloseAsync)}. If using a custom implementation of {nameof(Popup)}, override the {nameof(Popup.CloseAsync)} method"); +/// +/// An thrown when attempting to close a that cannot locate its associated . +/// +public sealed class PopupNotFoundException() : InvalidPopupOperationException($"Unable to close popup: could not locate {nameof(PopupPage)}. {nameof(PopupExtensions.ShowPopup)} or {nameof(PopupExtensions.ShowPopupAsync)} must be called before {nameof(Popup.CloseAsync)}. If using a custom implementation of {nameof(Popup)}, override the {nameof(Popup.CloseAsync)} method"); -sealed class PopupBlockedException(in Page currentVisibleModalPage) : InvalidPopupOperationException($"Unable to close Popup because it is blocked by the Modal Page {currentVisibleModalPage.GetType().FullName}. Please call `{nameof(Page.Navigation)}.{nameof(Page.Navigation.PopModalAsync)}()` to first remove {currentVisibleModalPage.GetType().FullName} from the {nameof(Page.Navigation.ModalStack)}"); +/// +/// An thrown when attempting to close a that is blocked by a visible modal page. +/// +public sealed class PopupBlockedException(in Page currentVisibleModalPage) : InvalidPopupOperationException($"Unable to close Popup because it is blocked by the Modal Page {currentVisibleModalPage.GetType().FullName}. Please call `{nameof(Page.Navigation)}.{nameof(Page.Navigation.PopModalAsync)}()` to first remove {currentVisibleModalPage.GetType().FullName} from the {nameof(Page.Navigation.ModalStack)}"); -class InvalidPopupOperationException(in string message) : InvalidOperationException(message); \ No newline at end of file +/// +/// An thrown when an invalid operation is performed on a . +/// +public class InvalidPopupOperationException(in string message) : InvalidOperationException(message); \ No newline at end of file