title: Access button in code behind c#
body: <p>I have a button in my xaml code "Check" and want to set it visibility to hidden or visible based on the version of the application that is running. I am currently trying to set it through pragma statements in the constructor but it says the name doesn't exist</p>
  
  <p>XAML code:</p>
  
  <pre><code>&lt;Button Style="{DynamicResource Main.Button}" Name="Check"
      Command="{Binding CheckCommand}" Content="Check Configured Units" Width="150"
      Height="{StaticResource Main.Button.Height}"  /&gt;
  </code></pre>
  
  <p>C# code behind:</p>
  
  <pre><code>public partial class SinglePlayerSummaryView : UserControl
  {
      public SinglePlayerSummaryView()
      {
          InitializeComponent();
  
  #if ReleaseStandard
          Check.Visibility = System.Windows.Visibility.Visible;
  #else
          Check.Visibility = System.Windows.Visibility.Hidden;
  #endif
      }
  }
  </code></pre>
  
  <p>Appreciate any help</p>