title: Access to a constructor parameter within MarkupExtension.ProvideValue
body: <p>I have <em>MyListYExtension</em> markup extension that has no default constructor. Therefore it can be created with constructor syntax only.
  Another <em>GetValueExtension</em> markup extension tries to determine the target type of value asked so that it can do necessary conversion. For example, if you assign the value of the second extension to a property of type <em>Double</em>, <em>GetValueExtension</em> understands it and returns 2.0 instead of "2". Dummy example:</p>
  
  <pre><code>{MyListX Capacity={GetValue ListCapacityParam}}    
  </code></pre>
  
  <p>Everything goes fine if I assign <em>GetValueExtension</em> to a property. Then the target type is accessible within <em>MarkupExtension.ProvideValue</em> via </p>
  
  <pre><code>((IProvideValueTarget)serviceProvider).TargetProperty.PropertyType
  </code></pre>
  
  <p>But when I apply <em>GetValueExtension</em> as a parameter for the constructor of <em>MyListYExtension</em>, then <em>TargetProperty</em> is null:</p>
  
  <pre><code>&lt;!-- no default constructor in MyListY --&gt;
  &lt;!-- the first parameter of MyListY is "int capacity" --&gt;
  {MyListY {GetValue ListCapacityParam}} 
  </code></pre>
  
  <p>When XAML parser is assigning values to properties, it performs the default conversion.
  But it doesn't do it when it takes the value from markup extension. It results in an exception that it cannot assign e.g. string value to double property.
  To avoid that I try to emulate the default conversion but for that the target type needs to be known.</p>
  
  <p><strong>I cannot find any workaround to determine the actual type of the constructor parameter</strong> within <em>MarkupExtension.ProvideValue</em> call.</p>
  
  <p>I can modify <em>GetValueExtension</em> but not <em>MyListYExtension</em>. </p>
  
  <p>What can I do to solve this?</p>