-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ShowMenuAction targeting null #40
Comments
Yes, the container must be a Page. |
I created a custom toolbar as a control template in the App class (it can be applied to any page and has custom images and controls ): `
` And the "OpenFilter" tapped event (handled in App.aaml.cs) is what should open the filter side menu. I can just use messaging center or an event to tell it to open the menu in whatever page is open in the "ContentPresenter" (the non toolbar area). But I already have another menu defined on that page using SlideOverKit. I was hoping this could be a universal workaround to the fact that slideOverKit only allows one menu per page. I've already managed to get two menus working (by using MasterDetailPage + SlideOverKit) but I need a third menu that slides out from the right. I thought that if this one was called from App.xaml/cs that it might be able to act as a third menu. Like I assumed it only works if the container is a Page... I also posted my issue (worded differently) on the Xamarin forum: https://forums.xamarin.com/discussion/comment/285072#Comment_285072 If you have any suggestions to get the third menu please let me know. |
@jessejiang0214 Hey I know this issue is 6 months old but I've encountered this same issue with a MasterDetailPage that implements the IMenuContainerPage interface. Here's my code: ` public class MasterDetailMenuPage : MasterDetailPage, IMenuContainerPage
` |
OK I've figured what I was doing wrong. Instead of targeting the MasterDetailsPage itself I had to target the Master page. I was doing this on iOS but not on Android. Thank you for your time. |
ShowMenuAction targeting null in ViewModel. Can anybody help ? |
im getting same issue. @Finneyv solution is very clear. Can you elaborate on fix, please/ Thanks. EDIT: stupid me. I figured it out. In the renderer (typeof() at the top) you have to edit and match the the calling page. |
I created a Control Template in my PCL App.xaml and App.xaml.cs to create a custom header for my application. I was just messing around to see if I could add a universal slide menu by having App.xaml.cs implement IMenuContainerPage. I set it all up, but the ShowMenuAction?.Invoke() targets null when I use it in the App class. Is this because its not actually a Page? or is there a way I could actually invoke the ShowMenuAction and HideMenuAction directly from the App class?
`using System;
using Xamarin.Forms;
using static EngApp.MainActivityPage;
using SlideOverKit;
namespace EngApp
{
public partial class App : Application, IMenuContainerPage
{
}`
XAML CONTROL TEMPLATE
`
`
The text was updated successfully, but these errors were encountered: