title: UWP wait for Textbox.Textchanged event to fire
body: <p>How to change the text in a UWP Textbox and wait for it's TextChanged to complete before moving on, or not fire the TextChanged event at all.</p>
  
  <p><strong>The scenario.</strong> 
  Main UI shows a red flag if the TextBox text changes - however, I need to reset it occasionally (TextBox.Text = "", or some other text), when that happens, I want my red flag to go green.</p>
  
  <p><strong>Expected process flow</strong></p>
  
  <pre><code>TextBox.Text = ""
  TextBox.Changed event fires - causing my flag to go red
  Reset flag to green
  </code></pre>
  
  <p><strong>Actual process flow</strong></p>
  
  <pre><code>TextBox.Text = ""
  Reset flag to green
  TextBox.Changed event fires - causing my flag to go red
  </code></pre>
  
  <p><strong>What I think is happening</strong>
  Setting the TextBox.Text causes an event to be added to dispatch queue, which doesn't fire until the UI thread is idle, this means the next command (Reset flag to green) happens before the TextChanged event is consumed. It's also possible that the event is waiting for the TextBox to finish rendering before firing the event, but I can't be certain.</p>
  
  <p><strong>Solution?</strong> 
  Any help appreciated.</p>