title: How to access a value in a TextBlock?
body: <p>I have a window with the following elements, and I'm trying to access the value contained in <code>&lt;TextBlock Name="armingValue"</code> but in my .xaml.cs file it doesn't seem to be recognised.</p>
  
  <p>What do I need to do to access the value?</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;DataTemplate DataType="{x:Type ArmingVM:ArmingItem}"&gt;
          &lt;CheckBox Margin="10,5" IsChecked="{Binding IsSet}" Content="{Binding Name}"/&gt;
      &lt;/DataTemplate&gt;
      &lt;DataTemplate DataType="{x:Type ArmingVM:ArmingBindingData}"&gt;
          &lt;DockPanel&gt;
              &lt;ItemsControl ItemsSource="{Binding ArmingItems}" HorizontalAlignment="Left"&gt;
                  &lt;ItemsControl.ItemsPanel&gt;
                      &lt;ItemsPanelTemplate&gt;
                          &lt;StackPanel Orientation="Vertical"/&gt;
                      &lt;/ItemsPanelTemplate&gt;
                  &lt;/ItemsControl.ItemsPanel&gt;
              &lt;/ItemsControl&gt;
              &lt;TextBlock Text="Enum Value: " HorizontalAlignment="Right"/&gt;
              &lt;TextBlock Name="armingValue" Text="{Binding Value}" HorizontalAlignment="Right"/&gt;
          &lt;/DockPanel&gt;
      &lt;/DataTemplate&gt;
  &lt;/Window.Resources&gt;
  
  &lt;Grid&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="193*" /&gt;
          &lt;ColumnDefinition Width="551*" /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
  
      &lt;Button Content="Get Panel Options" Name="btnGetOptionsConfigruation" Margin="12,12,23,396" Click="btnGetOptionsConfigruation_Click"&gt;&lt;/Button&gt;
  
      &lt;StackPanel Grid.Column="1" Height="325" HorizontalAlignment="Left" Margin="68,43,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="438"&gt;
          &lt;ItemsControl Name="armingItemsControl" ItemsSource="{Binding}"/&gt;
      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  </code></pre>