title: How to display alert box with Xamarin.Forms for validation?
body: <p>How to <strong>display alert box with Xamarin.Forms</strong> for validation?</p>
  
  <p>I know that we can display alert using below code from ContentView code behind but I want to display <strong>alertbox from my ViewModel.</strong></p>
  
  <pre><code>DisplayAlert ("Alert", "You have been alerted", "OK");
  </code></pre>
  
  <p>I've registered my <strong>ViewModel against View</strong> with below code.</p>
  
  <pre><code>ViewFactory.Register&lt;[ContentPage], [ContentPageViewModel]&gt; (); 
  </code></pre>