title: How can I manually tell an owner-drawn WPF Control to refresh/redraw without executing measure or arrange passes?
body: <p>We are doing custom drawing in a control subclass's <code>OnRender</code>.  This drawing code is based on an external trigger and data.  As such, whenever the trigger fires, we need to re-render the control based on that data. What we're trying to do is find out how to force the control to re-render but without going through an entire layout pass.</p>
  
  <p>As stated above, most answers I've seen revolve around invalidating the <code>Visual</code> which invalidates the layout which forces new measure and arrange passes which is very expensive, especially for very complex visual trees as ours is.  But again, the layout does <em>not</em> change, nor does the VisualTree. The only thing that does is the external data which gets rendered differently. As such, this is strictly a pure rendering issue.</p>
  
  <p>Again, we're just looking for a simple way to tell the control that it needs to re-execute <code>OnRender</code>.  I have seen one 'hack' in which you create a new <code>DependencyProperty</code> and register it with 'AffectsRender' which you just set to some value when you want to refresh the control, but I'm more interested in what's going on inside the default implementation for those properties: what they call to affect that behavior.</p>
  
  <hr>
  
  <h2>Update:</h2>
  
  <p>Well, it looks like there isn't any such call as even the <code>AffectsRender</code> flag still causes an Arrange pass internally (as per CodeNaked's answer below) but I've posted a second answer that shows the built-in behaviors as well as a work-around to suppress your layout pass code from running with a simple nullable size as a flag. See below.</p>