title: Passing values to IValueConverter
body: <p>I have a <code>ListView</code> that has a <code>Grid</code> with two columns and many rows. Each row has a <code>TextBlock</code> in each column with each <code>Text</code> property binded to a value in ListView's <code>ItemSource</code>. I need to do some converting of the text in the second <code>TextBlock</code> depending on the value in the first <code>TextBlock</code>. How can I get the value of the first text box to the converter?</p>
  
  <p>Here is what I have so far:</p>
  
  <p><strong>XAML:</strong></p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;local:ValueStringConverter x:Key="valueStringConverter" /&gt;
  &lt;/UserControl.Resources&gt;
  
  &lt;ListView Name="theListView" ItemsSource="{Binding ItemCollection}" SelectedItem="{Binding SelectedItem}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.Row="1" &gt;
      &lt;ListView.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;Grid&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition Height="Auto" /&gt;
                  &lt;/Grid.RowDefinitions&gt;
  
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="Auto" /&gt;
                      &lt;ColumnDefinition Width="*" /&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
  
                  &lt;TextBlock Text="{Binding Path=Key}" Grid.Column="0" Margin="0,0,10,0" /&gt;
                  &lt;TextBlock Text="{Binding Path=Value, Converter={StaticResource valueStringConverter}}" TextWrapping="Wrap" Grid.Column="1" /&gt;
              &lt;/Grid&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListView.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>Code of <code>ValueStringConverter</code>:</p>
  
  <pre><code>public class ValueStringConverter : IValueConverter
  {
      public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
      {
          string name = (string)value;
          name = name.Replace("$$", " ");
          name = name.Replace("*", ", ");
          name = name.Replace("##", ", ");
  
          return value;
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
      {
          throw new NotImplementedException();
      }
  }
  </code></pre>