title: Value Converter Without Binding On Image Source - conversion
body: <p>I bind string property from view model class on image source in view. String property can have value 1 for man and 2 for woman. I use also converter on binding which returns uri for image source.</p>
  
  <p>In view I have this:</p>
  
  <pre><code>    &lt;Image Style="{StaticResource InfoIcon}" 
             Source="{Binding ., Mode=OneWay,UpdateSourceTrigger=PropertyChanged,
                  Converter={StaticResource sexImgConverter}, 
                  ConverterParameter=Oponent.Info.Sex}"/&gt;
  </code></pre>
  
  <p>Converter method is here:</p>
  
  <pre><code>    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
      {
  
          const string woman = "/images/icons/chat/woman.png";
          const string man = "/images/icons/chat/man.png";
  
          string result = string.Empty;
  
          string result = int.Parse(value.ToString()) == 1 ? man : woman;
  
          return new Uri(result);
      }
  </code></pre>
  
  <p>Problem is I bind property sex (in view Oponent.Info.Sex) which is type string and parse to integer.</p>
  
  <p>But if I add debuger break point on line :</p>
  
  <pre><code>string resul = int.Parse(value.ToString()) == 1 ? man : woman;
  </code></pre>
  
  <p><strong>I see that value is type of my view model class.</strong> </p>
  
  <p>I try use this convert method no another bind, here is it:</p>
  
  <pre><code>&lt;TextBlock Style="{StaticResource InfoText}"&gt;
       &lt;TextBlock.Text&gt;
          &lt;MultiBinding StringFormat="{}{0}, {1} rokov"&gt;
              &lt;Binding Path="Oponent.Info.Sex" Converter="{StaticResource sexConverter}"/&gt;
              &lt;Binding Path= "Oponent.Info.Age"/&gt;
          &lt;/MultiBinding&gt;
      &lt;/TextBlock.Text&gt;
  &lt;/TextBlock&gt;
  </code></pre>
  
  <p>I use the same conveter add debuger break point on line:</p>
  
  <pre><code>string resul = int.Parse(value.ToString()) == 1 ? man : woman;
  </code></pre>
  
  <p>I see the value is type of string.</p>
  
  <p>What have I done wrong?</p>