Is there any way to handle opening Flyout? I'm trying to add custom behavior during opening or after opening Flyout.
I can;t find any type of propety like
Shell.OnFlyoutOpening="flyout_opening"
Since there is no and won't be events such OnFlyoutOpened
OnFlyoutClosed
, you can listen to your Shell PropertyChanged
event, if the property is FlyoutIsPresented then execute your code:
public AppShell()
{
InitializeComponent();
PropertyChanged += Shell_PropertyChanged;
}
private void Shell_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName.Equals("FlyoutIsPresented"))
if (FlyoutIsPresented)
OnFlyoutOpened();
else
OnFlyoutClosed();
}
Depending on your requirement you will define OnFlyoutOpened()
and OnFlyoutClosed()
methods.
Thanks to @PureWeen guidance in discussion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With