How to disable Application Bar Buttons in Windows Phone 8/8.1(Silverlight Apps)

There might certain cases where you want to disable app bar in you windows phone app,it may be pivot,panoroma,single page app.
So to do this just simply copy the code below and paste it .and use it where ever u need to disbale app bar.To completely hide app bar use this code (ApplicationBar.IsVisible = false;).
  1. ApplicationBar.Disable();  
  1. public static void Disable(this IApplicationBar appBar)    
  2. {    
  3.     if (!ReferenceEquals(appBar, null))    
  4.     {    
  5.         appBar.IsMenuEnabled = false;    
  6.         foreach (var obj in appBar.Buttons)    
  7.         {    
  8.             var button = obj as ApplicationBarIconButton;    
  9.             if (button != null)    
  10.                 button.IsEnabled = false;    
  11.         }    
  12.     }    
  13. }    
If you have any doubts comment below.