Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 52a260c

Browse files
authored
[Bug] [Fixed] #1712 (#1713)
1 parent fc0080e commit 52a260c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

samples/XCT.Sample/Pages/Views/Popups/NoLightDismissPopup.xaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
<StackLayout Style="{StaticResource PopupLayout}">
3535
<Label
3636
Style="{StaticResource Title}"
37-
Text="Simple Popup" />
37+
Text="Simple Popup Without Light Dismiss" />
3838
<BoxView Style="{StaticResource Divider}" />
3939
<Label
4040
Style="{StaticResource Content}"
4141
Text="{OnPlatform
4242
Android='This is a native popup with a Xamarin.Forms View being rendered. The behaviors of the popup will confirm to 100% native look and feel, but still allows you to use your Xamarin.Forms controls.',
4343
iOS='This is a native popup with a Xamarin.Forms View being rendered. The behaviors of the popup will confirm to 100% native look and feel, but still allows you to use your Xamarin.Forms controls.',
44-
UWP='UWP Flyouts do not support toggling light dismiss mode. On UWP this will always dismiss the flyout if you tap outside of the control'}" />
44+
UWP='UWP Flyouts do not have native support for toggling light dismiss mode. On UWP this will disrupt the closing of the flyout if you tap outside of the control'}" />
4545
<Button
4646
Text="Close"
4747
VerticalOptions="EndAndExpand"

src/CommunityToolkit/Xamarin.CommunityToolkit/Views/Popup/UWP/PopupRenderer.uwp.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ void ConfigureControl()
111111

112112
void SetEvents()
113113
{
114-
if (Element?.IsLightDismissEnabled is true)
115-
Closing += OnClosing;
114+
Closing += OnClosing;
116115

117116
if (Element != null)
118117
Element.Dismissed += OnDismissed;
@@ -273,6 +272,8 @@ void OnClosing(object? sender, object e)
273272
{
274273
if (isOpen && Element?.IsLightDismissEnabled is true)
275274
Element.LightDismiss();
275+
if (isOpen && e is FlyoutBaseClosingEventArgs args)
276+
args.Cancel = true;
276277
}
277278

278279
void OnOpened(object sender, object e) =>

0 commit comments

Comments
 (0)