AndreiMisiukevich/ContextMenu

SideContextMenuView: auto close when tapped

nielscup opened this issue · 4 comments

How do I auto close the context menu after tapping a context menu item? In the example it remains open when tapped which is not desired.

Hi, you should call ForceClose or ForceCloseCommand

e.g.

SideContextMenuView?.LastOpenedView?.ForceClose();

Thanks for your quick response!! How do I reference the SideContextMenuView? Via the TapGesture?

<SideContextMenuView x:Name="context" />

<TapGestureRecognizer Command="{Binding ForceCloseCommand, Source={x:Reference context}}"

Smth like this