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