0

I am using MVVMCross along with Xamarin in my iOS app. I want to implement a popover menu that is activated when a button is clicked (see image below). I have a homeview for my table and menuview for the menu (with an associated MvxViewModel for each). All standard stuff.

What I am struggling with is how to pass the anchor point (i.e. the top right button) from the homeview to the menuview.

Any pointers in the right direction would be great. Thanks

enter image description here

FinniusFrog
  • 97
  • 1
  • 8
  • Have you developed the UI like your reference Image in iOS? This may link may help if you have not seen early https://stackoverflow.com/a/32295907/8892050. – Ranjit Jun 06 '21 at 11:37
  • Hi @Ranjit, It is. I actually did get some valuable info from that question earlier when developing the concept. The issue I have now is that I actually want to bind the menu view to it's only ViewModel using mvvmcross. I've managed to get it working a built in property for popovers and now just need to create my own for menu. Thanks anyway. – FinniusFrog Jun 07 '21 at 12:26

1 Answers1

0

After reading and re-reading the commit comments for the feature at MvvmCross I realised I needed to add the following code to the home view:

var provider = Mvx.IoCProvider.Resolve<IMvxPopoverPresentationSourceProvider>();
provider.SourceView = CategoryLabel;

The above anchors the popover to the Category Label.

FinniusFrog
  • 97
  • 1
  • 8