title: WPF DataBinding with simple arithmetic operation?
body: <p>I want to add a constant value onto an incoming bound integer. In fact I have several places where I want to bind to the same source value but add different constants. So the ideal solution would be something like this...</p>
  
  <pre><code>&lt;TextBox Canvas.Top="{Binding ElementName=mySource, Path=myInt, Constant=5}"/&gt;
  &lt;TextBox Canvas.Top="{Binding ElementName=mySource, Path=myInt, Constant=8}"/&gt;
  &lt;TextBox Canvas.Top="{Binding ElementName=mySource, Path=myInt, Constant=24}"/&gt;
  </code></pre>
  
  <p>(NOTE: This is an example to show the idea, my actual binding scenario is not to the canvas property of a TextBox. But this shows the idea more clearly)        </p>
  
  <p>At the moment the only solution I can think of is to expose many different source properties each of which adds on a different constant to the same internal value. So I could do something like this...</p>
  
  <pre><code>&lt;TextBox Canvas.Top="{Binding ElementName=mySource, Path=myIntPlus5}"/&gt;
  &lt;TextBox Canvas.Top="{Binding ElementName=mySource, Path=myIntPlus8}"/&gt;
  &lt;TextBox Canvas.Top="{Binding ElementName=mySource, Path=myIntPlus24}"/&gt;
  </code></pre>
  
  <p>But this is pretty grim because in the future I might need to keep adding new properties for new constants. Also if I need to change the value added I need to go an alter the source object which is pretty naff. </p>
  
  <p>There must be a more generic way than this? Any WPF experts got any ideas?</p>