title: RichTextBox TextChanged gets called when Page initialises
body: <p>I have a WPF RichTextBox and when the user types something into it I want to detect this and call a function.</p>
  
  <p>The function checks all the other controls on my Page to see if they are all selected and then activates a NEXT button. (I'm building a questionaire)</p>
  
  <p>The problem I'm having is that when the Page initialises when my program starts up, the RichTextBox TextChanged event is called and other controls (ComboBoxes) are not yet initialised and the program bombs out.</p>
  
  <p>How can I stop the TextChanged event from getting called on start up??  Or how can I handle this situation?</p>
  
  <pre><code>public PageFaultReport()
  {
      InitializeComponent();
  }
  
  private void RichTextBox_DescribeProblem_TextChanged(object sender, TextChangedEventArgs e)
  {
      ActivateNextIcon();
  }
  
  private void ActivateNextIcon()
  {
      ComboBoxItem OperatingSystem = (ComboBoxItem)Combo_OS.SelectedItem;
      ComboBoxItem Version         = (ComboBoxItem)Combo_Version.SelectedItem;
  
      TextRange textRangeDetailedSteps = new TextRange(RichTextBox_DescribeProblem.Document.ContentStart, RichTextBox_DescribeProblem.Document.ContentEnd);
      int detailedStepsLength = textRangeDetailedSteps.Text.Length;
  
      if (YesNo_Permission.Selected == true &amp;&amp; OperatingSystem != null &amp;&amp; Version != null &amp;&amp; YesNo_HardwareKey.Selected == true &amp;&amp; YesNo_ExceededConnections.Selected == true &amp;&amp; detailedStepsLength &gt; 0)
      {
          Image_Forward.IsEnabled = true;
      }
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>&lt;Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:UserControls="clr-namespace:InstallerToolkit.UserControls" x:Class="InstallerToolkit.Pages.PageFaultReport" 
    mc:Ignorable="d" 
    d:DesignHeight="525" d:DesignWidth="1050"
    Title="PageFaultReport"
    Loaded="Page_Loaded"&gt;
  
  &lt;RichTextBox x:Name="RichTextBox_DescribeProblem" FontSize="14" HorizontalAlignment="Left" Height="93" VerticalAlignment="Top" Width="894" Margin="75,295,0,0" TextChanged="RichTextBox_DescribeProblem_TextChanged" &gt;
      &lt;FlowDocument&gt;
          &lt;Paragraph LineHeight="1"/&gt;
      &lt;/FlowDocument&gt;
  &lt;/RichTextBox&gt;
  </code></pre>