Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
<StackLayout Style="{StaticResource PopupLayout}">
<Label
Style="{StaticResource Title}"
Text="Simple Popup" />
Text="Simple Popup Without Light Dismiss" />
<BoxView Style="{StaticResource Divider}" />
<Label
Style="{StaticResource Content}"
Text="{OnPlatform
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.',
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.',
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'}" />
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'}" />
<Button
Text="Close"
VerticalOptions="EndAndExpand"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ void ConfigureControl()

void SetEvents()
{
if (Element?.IsLightDismissEnabled is true)
Closing += OnClosing;
Closing += OnClosing;

if (Element != null)
Element.Dismissed += OnDismissed;
Expand Down Expand Up @@ -273,6 +272,8 @@ void OnClosing(object? sender, object e)
{
if (isOpen && Element?.IsLightDismissEnabled is true)
Element.LightDismiss();
if (isOpen && e is FlyoutBaseClosingEventArgs args)
args.Cancel = true;
}

void OnOpened(object sender, object e) =>
Expand Down