title: Set the FontFamily of a RichEditBox from code behind in UWP
body: <p>I have a RichEditBox that I want to change the FontFamily of dynamically</p>
  
  <p>I've tested that setting the FontFamily in XAML works as the line below changes the font correctly to <code>Consolas</code>:</p>
  
  <pre><code>&lt;RichEditBox x:Name="MainDocument" Width="750" Height="1500" Margin="0,175,0,25" Loaded="MainDocument_Loaded" FontFamily="Consolas"&gt;
  </code></pre>
  
  <p>However, I want to be able to set the font inside C# as opposed to XAML in order to dynamically update the box when I want. I've tried the following line:</p>
  
  <pre><code>MainDocument.FontFamily = new FontFamily("Consolas");
  </code></pre>
  
  <p>But the font always defaults back to <code>Segoe UI</code>.</p>
  
  <p>How can I set the font in code behind in UWP?</p>