title: How to intercept back buttons xamarin forms?
body: <p>How can I intercept the back button events in xamarin forms for Android and IOS and be able to show the user an alert to confirm the exit?</p>
  
  <p>The objective is to intercept the 2 buttons, the navigation menu (yellow) and the device (orange)</p>
  
  <p>I have seen some examples, but they are several years old. </p>
  
  <p>I am using VS 2019 and the latest version of xamarin forms.</p>
  
  <p><a href="https://i.stack.imgur.com/BSQ6g.png" rel="noreferrer"><img src="https://i.stack.imgur.com/BSQ6g.png" alt="enter image description here"></a></p>
  
  <p>Thank you in advance for your help.</p>