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

BackButtonBehavior in Shell not working

$
0
0

I have set a BackButtonBehavior in a ContentPage like this..

<Shell.BackButtonBehavior><BackButtonBehavior Command="{Binding BackCommand}"/></Shell.BackButtonBehavior>

I've created the command in my viewmodel (which is the BindingContext) like this...

public ICommand BackCommand { private set; get; }

public ViewModel()
{
    BackCommand = new Command(() =>
    {
        int x = 10;
    });            
}

I set a breakpoint on the line that reads "int x = 10" and when pressing the back button on the Navigation bar, the breakpoint is never hit.

I have tried Xamarin.Forms 4.4.0.99xxxx. and 4.5.0.356


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>