title: When manipulating a RichEditBox at runtime (search for links & setting them, etc.), code continues executing out of turn
body: <p>I have a RichEditBox that I use as a common RTF editor. When the user types text into the editor, the TextChanging event repeatedly searches the content for links, and then marks them. It also does other simple formatting to the link, like change the color of the link, etc.</p>
  
  <p>My SetHyperlinks() function that does this work, however, still appears to be executing, even though the system has moved on to the next line of code below that function. But the code below the SetHyperlinks() function call depends on the SetHyperlinks() function finishing its work before executing. Am I making sense? </p>
  
  <pre><code>RichEditBox_TextChanging(RichEditBox sender, RichEditBoxTextChaningEventArgs args)
  {
      this.SetHyperlinks(sender.Document.Selection);
  
      // Before SetHyperlinks() finishes, the code below it starts executing.
      // It is as if the SetHyperlinks() method needs an awaiter.
  
      var variableThatDependsOnSetHyperlinksResults;
  }
  </code></pre>
  
  <p>Also, I am using UWP if that matters. Thanks.</p>