title: A delayed binding from source
body: <p>Consider the following ViewModel property:</p>
  
  <pre><code>private string _slowProperty;
  public string SlowProperty
  {
      get { return _slowProperty; }
      set
      {
          _slowProperty = value;
          RaisePropertyChanged("SlowProperty");
      }
  }
  </code></pre>
  
  <p>Which is bound to a textbox, like so:</p>
  
  <pre><code>&lt;TextBox Text="{Binding SlowProperty}" /&gt;
  </code></pre>
  
  <p>Now, the problem here is that every time the value of SlowProperty changes, and it does so quite often, the textbox would go and try to get its value, which is, quite slow. I could alleviate the situation using async binding, however, that would still be wasting CPU cycles.</p>
  
  <p>Instead, what I'd like to have is something like:</p>
  
  <pre><code>&lt;TextBlock Text="{z:DelayedSourceBinding SlowProperty}" /&gt;
  </code></pre>
  
  <p>Which would try to get the binding after a certain delay. So for example if the <code>SlowProperty</code>changed 5 times in a row, within a short while, then only the last text would be visible in the textbox.</p>
  
  <p>I've found the <a href="http://www.paulstovell.com/wpf-delaybinding" rel="nofollow noreferrer">following project</a> that performs something like that, so it my example I could use it like so:</p>
  
  <pre><code>&lt;TextBox Text="{z:DelayBinding Path=SearchText}" /&gt;
  </code></pre>
  
  <p>The problem with it, is that it only updates the binding <strong>target</strong> after a delay. The source path, however, is evaluated and its getter is executed upon every change of the source. Which, in the case of <code>SlowProperty</code> would still waste CPU cycles.</p>
  
  <p>I've tried to make my own delayed binding class, but <a href="https://stackoverflow.com/questions/8634909/subscribing-to-an-event-of-a-binding-class-in-custom-markupextension">got stuck</a>. Is there any other binder that can do anything like that?</p>
  
  <p>For completeness sake, here are 2 other projects that perform similar tasks, yet, none address the problem I am experiencing:</p>
  
  <p><a href="http://julmar.com/blog/mark/?p=30" rel="nofollow noreferrer">DeferredBinding</a> - A similar solution to DelayBinding. However, it is a bit more complex to use.</p>
  
  <p><a href="http://www.codeproject.com/KB/WPF/DelayedBindingTextBox.aspx" rel="nofollow noreferrer">DelayedBindingTextBox</a> - Implements delayed binding using a custom textbox control.</p>
  
  <p>Thanks!</p>