change navigation bar of master detail page xamarin form

C#
async void OnRootPageButtonClicked (object sender, EventArgs e)
{
  await Navigation.PopToRootAsync ();
}

Source

Also in C#: