Skip to content

MasterDetail BackButton #1

@farukaf

Description

@farukaf

Hello,

Loved this manager.

First: https://www.nuget.org/packages/CHD.HWBackButtonManager
The github link on the page above have a typo on the end of the link...

Now the question:
It worked with the backbutton but how can I made the back button on the master detail menu trigger the same methods?
` protected override void OnAppearing()
{
base.OnAppearing();

        bool OnBackButtonPressed()
        {
            ConfirmLeave();
            return false; //false ignore backbutton
        }

        HWBackButtonManager.OnBackButtonPressedDelegate onBackButtonPressedDelegate = new HWBackButtonManager.OnBackButtonPressedDelegate(OnBackButtonPressed);

        HWBackButtonManager.Instance.SetHWBackButtonListener(onBackButtonPressedDelegate);


    }

    private async void ConfirmLeave()
    {
        var rslt = await DisplayAlert(":o",
                                     "Are you sure?",
                                     "Yep", "Nop");
        if (rslt)
        {
            await Navigation.PopAsync();
        }
    }`

Thanks by advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions