Template10 icon indicating copy to clipboard operation
Template10 copied to clipboard

BackRequested not raised when clicking back button on PageHeader

Open IIARROWS opened this issue 10 years ago • 14 comments

This is a follow up of this issue: #463 The BackRequested is raised only using hardware buttons, I tried with Windows Phone emulator and the back button on my mouse. It doesn't work clicking the back button on PageHeader on PC.

On 1.1.11

IIARROWS avatar May 26 '16 15:05 IIARROWS

What version is being used

mvermef avatar May 26 '16 16:05 mvermef

My bad, is 1.1.11, updated to its stable version. But it's not only on stable, it happened on the previous beta too.

IIARROWS avatar May 26 '16 17:05 IIARROWS

I just ran my app on my phone it works just fine with the backbutton.

mvermef avatar May 26 '16 20:05 mvermef

Well, on phone it works because you have only the physical button and that works as I said. The issue happens only using the software back button on the page header, it directly call the OnNavigationFromAsync without passing through the FrameFacade.BackRequested event.

This is the code:

public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary<string, object> state)
{
    NavigationService.FrameFacade.BackRequested += FrameFacade_BackRequested;
    await Task.CompletedTask;
}

public override async Task OnNavigatingFromAsync(NavigatingEventArgs args)
{
    NavigationService.FrameFacade.BackRequested -= FrameFacade_BackRequested;//Unsubscribe
    await Task.CompletedTask;
}

public async void FrameFacade_BackRequested(object sender, HandledEventArgs e)
{
    //My Logic here
}

IIARROWS avatar May 27 '16 06:05 IIARROWS

Yeah sorry misread your OP, I will look at it shortly. You are just trying to intercept the back request and add some additional logic..

mvermef avatar May 27 '16 14:05 mvermef

played around alittle see if I could duplicate and it does appear to be skipping... not sure why.

mvermef avatar May 29 '16 19:05 mvermef

I anyone else getting this behavior? @Windows-XAML/community

JerryNixon avatar Jun 04 '16 01:06 JerryNixon

I noticed this back in February. I can't personally confirm it still exists as I haven't used Template10 in a while (I've been busy with other types of projects).

oadugmore avatar Jun 04 '16 01:06 oadugmore

I'm using version 1.1.10 and have exactly the same code and works very fine, both with the hardware button and with the software one on desktop.

effpath999 avatar Jun 04 '16 01:06 effpath999

I can't check it now, but can you try to update to latest version? You can always switch back if you don't want to update your solution.

IIARROWS avatar Jun 04 '16 22:06 IIARROWS

@IIARROWS sorry for answering so late, but i didn't have time to check it before today. So I try to upgrade my project to use Template10 1.1.11 but still my event handler is called correctly.

effpath999 avatar Jun 09 '16 15:06 effpath999

Nothing to be sorry about, thank you for your help...

IIARROWS avatar Jun 09 '16 18:06 IIARROWS

To me it's not close, I still get this behavior... I just couldn't respond because I was busy.

IIARROWS avatar Jul 08 '16 11:07 IIARROWS

Hello all,

I request this to be reopened, for me this issue is still there (Template10 V1.1.12). In my app I have to override the default back behavior. And the only way to hit my custom BackRequest event is when the shell back button is disabled.

JWH89 avatar Feb 14 '17 14:02 JWH89