0

I want to do something like this example, but i can't. I try a lot of plugins and I cant find the way to implement.

Someone know or can tell me how can I do?

I want to show a display popup menu when click in one ToolbarItem on a MasterDetailPage.

My actual app:

enter image description here

What i want:

enter image description here

mindOfAi
  • 4,412
  • 2
  • 16
  • 27
kvaldes
  • 3
  • 2

1 Answers1

0

I think you can take a look to SlideOverKit

public SlideDownMenuView ()
{
    InitializeComponent ();

    // You must set HeightRequest in this case
    this.HeightRequest = 600;
    // You must set IsFullScreen in this case, 
    // otherwise you need to set WidthRequest, 
    // just like the QuickInnerMenu sample
    this.IsFullScreen = true;
    this.MenuOrientations = MenuOrientation.TopToBottom;

    // You must set BackgroundColor, 
    // and you cannot put another layout with background color cover the whole View
    // otherwise, it cannot be dragged on Android
    this.BackgroundColor = Color.FromHex ("#D8DDE7");         
}

Otherwise with enter link description here

you can try with this code...

public partial class App : Application
{
    public App()
    {
        InitializeComponent();

        MasterDetailPage mdpage = new MasterDetailPage();
        mdpage.Master = new ContentPage() { Title = "Master", BackgroundColor = Color.Red };
        ToolbarItem tbi = new ToolbarItem() { Text = "POPUP" };
        tbi.Clicked += async (object sender, System.EventArgs e) => {

            StackLayout sl = new StackLayout() { HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.Start, BackgroundColor = Color.Pink, WidthRequest  = 100, HeightRequest = 200 };
            Rg.Plugins.Popup.Pages.PopupPage mypopup = new Rg.Plugins.Popup.Pages.PopupPage() {BackgroundColor = Color.Transparent };
            mypopup.Content = sl;
            await MainPage.Navigation.PushPopupAsync(mypopup);
        };
        ContentPage detail = new ContentPage() { Title = "Detail", BackgroundColor = Color.Green,  };
        detail.ToolbarItems.Add(tbi);
        mdpage.Detail = new NavigationPage(detail);
        MainPage = mdpage;
    }

    protected override void OnStart()
    {
        // Handle when your app starts
    }

    protected override void OnSleep()
    {
        // Handle when your app sleeps
    }

    protected override void OnResume()
    {
        // Handle when your app resumes
    }
}
Alessandro Caliaro
  • 5,623
  • 7
  • 27
  • 52
  • I use SlideOverKit to show a menu BottomToTop in Tabbedpage and works ok, but cant asign it to toptobottom as you say because its a MasterDetailPage,and I dont know how to implement it. – kvaldes Mar 09 '17 at 09:15
  • have you tried this plugin https://github.com/rotorgames/Rg.Plugins.Popup – Alessandro Caliaro Mar 09 '17 at 09:17
  • Yes, but it does not work, it shows badly and darkens the back window, I just want to display a drop down menu.. this is my code: – kvaldes Mar 09 '17 at 09:23
  • Thank you very much, it works perfectly with that code!! :) – kvaldes Mar 09 '17 at 13:48