title: WPF, passing variable to converter inside data template
body: <p>I assume this is possible but not sure how to do it. I need to pass the value of a class level variable to a converter, from within side a data template.</p>
  
  <pre><code>&lt;DataTemplate x:Key="ResponseItemTemplate"&gt;
          &lt;StackPanel Orientation="Horizontal" &gt;
              &lt;StackPanel.Visibility&gt;
                  &lt;MultiBinding Converter="{StaticResource VisibilityConverter}"&gt;
                      &lt;Binding Path="Key"/&gt;
                      &lt;Binding Path="CurrentLanguage"/&gt; 
                  &lt;/MultiBinding&gt; 
              &lt;/StackPanel.Visibility&gt;
  
              &lt;TextBox Width="200" Text="{Binding Value}" /&gt;
          &lt;/StackPanel&gt;
      &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>The 'Key' value exists on the response item for the data template so this gets passed correctly, whereas the CurrentLanguage is a class variable and I can't get that to pass properly to the converter. Any ideas?</p>