title: MarkupExtension as computed property in Template
body: <p>Having such MarkupExtension</p>
  
  <pre><code>public class Extension1 : MarkupExtension
  {
      private static int _counter = 0;
  
      public override object ProvideValue(IServiceProvider serviceProvider)
      {
          return string.Format("Item {0}", _counter++);
      }
  }
  </code></pre>
  
  <p>and this XAML</p>
  
  <pre><code>&lt;ListBox&gt;
    &lt;ListBoxItem Content="{my:Extension1}"&gt;&lt;/ListBoxItem&gt;
    &lt;ListBoxItem Content="{my:Extension1}"&gt;&lt;/ListBoxItem&gt;
    &lt;ListBoxItem Content="{my:Extension1}"&gt;&lt;/ListBoxItem&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>I get such list:</p>
  
  <pre><code>Item 1
  Item 2
  Item 3
  </code></pre>
  
  <p>Now I try to generate the same list using this Style</p>
  
  <pre><code>&lt;Style TargetType="ListBoxItem"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="ListBoxItem"&gt;
                  &lt;TextBox Text="{my:Extension1}"&gt;&lt;/TextBox&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>And with such XAML</p>
  
  <pre><code>&lt;ListBox ItemsSource="{StaticResource data}"&gt;&lt;/ListBox&gt;
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Item 0
  Item 0
  Item 0
  </code></pre>
  
  <p>So {my:Extension1} evaluated only once. Can I create a computed property that will be evaluated for every item?</p>