BackRequested not raised when clicking back button on PageHeader
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
What version is being used
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.
I just ran my app on my phone it works just fine with the backbutton.
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
}
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..
played around alittle see if I could duplicate and it does appear to be skipping... not sure why.
I anyone else getting this behavior? @Windows-XAML/community
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).
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.
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 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.
Nothing to be sorry about, thank you for your help...
To me it's not close, I still get this behavior... I just couldn't respond because I was busy.
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.