Skip to content

Commit c4e41c7

Browse files
committed
Add trace log for null Window in action sheet
Added a Trace.WriteLine statement to log when DisplayActionSheetAsync is called but the page is not attached to a window. This helps with debugging scenarios where the action sheet is not shown due to the page being detached.
1 parent 1ca1644 commit c4e41c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Controls/src/Core/Page/Page.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public Task<string> DisplayActionSheetAsync(string title, string cancel, string
327327
// If page is no longer attached to a window (e.g., navigated away), ignore the action sheet request
328328
if (Window is null)
329329
{
330-
// Complete the task with cancel result
330+
Trace.WriteLine("DisplayActionSheetAsync: Window is null, action sheet will not be shown. This can happen if the page is not attached to a window.");
331331
args.SetResult(cancel);
332332
return args.Result.Task;
333333
}

0 commit comments

Comments
 (0)