title: Check if element is collapsed or visible
body: <p>I want to check if a element is collapsed or visible so I can unhide or hide it but I keep getting the error </p>
  
  <blockquote>
    <p>CS0029 Cannot implicitly convert type 'Windows.UI.Xaml.Visibility' to 'bool.</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>if (Test1.Visibility == Visibility.Visible)
  {
      Test1.Visibility = Visibility.Collapsed;
  }
  </code></pre>