Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

MasterDetailPage IsPresented is completely ignored.

$
0
0

Two issues:

(1) If I set IsPresented = true on the OnAppearing() method of my MasterDetailPage, the Master menu is shown and then is immediately closed automatically. A video showing the Master closing on load: https://dl.dropboxusercontent.com/u/11453596/Videos/masterClosing.mov

    protected override void OnAppearing()
    {
        base.OnAppearing();
        IsPresented = true;
    }

(2) If I set IsPresented = true anywhere else, nothing happens at all.

I'm using Xamarin.Forms 1.3.0.6292. Any idea?


public class HomePage : MasterDetailPage
{
    public HomePage()
    {
        Detail = new Detail();
        Master = new ContentPage() {
            Title = "Master...",
            Content = new Label {
                    Text = "Master..."
            }
        };

        IsGestureEnabled = false;
    }

    protected override void OnAppearing()
    {
        base.OnAppearing();
        IsPresented = true;
    }
}

public class Detail : ContentPage
{
    public Detail()
    {
        var bt = new Button() {
            Text = "Drawer"
        };
        bt.Clicked += (sender, e) => App.Master.IsPresented = true;

        Content = bt;
    }
}

Viewing all articles
Browse latest Browse all 77050

Trending Articles