title: SetSysTrayVisible bug Windows Phone 8
body: <p>There is a random bug as mentioned below which says something wrong while setting the <code>SystemTray</code> visibility. I have set the <code>SystemTray</code> visibility to false in xaml. It randomly crashes the app sometimes and not always. The exception thrown is  <code>System.ArgumentException</code> <code>Value does not fall within the expected range.</code> </p>
  
  <p>The stacktrace is as below</p>
  
  <pre><code>Microsoft.Phone.Shell.Interop.NativeSystemTrayMethods.SetSysTrayVisible(IntPtr pSysTray, Boolean fVisible)    
  Microsoft.Phone.Shell.Interop.NativeSystemTrayInteropWrapper.SetSystemTrayVisible(Boolean isVisible)
  Microsoft.Phone.Controls.PhoneApplicationPage.set_SystemTrayIsVisible(Boolean value)
  Microsoft.Phone.Controls.PhoneApplicationPage..ctor()
  </code></pre>
  
  <p>What can be the probable reason for it? Any workarounds? Any leads are appreciated. </p>