title: User Control throws "given key was not present in the dictionary"
body: <p>I have discovered the <em>given key was not present in the dictionary</em> issue.
  I'm seeing this behaviour:</p>
  
  <ul>
  <li>the preview in the xaml editor is sometimes shown. Sometimes it shows an exeption</li>
  <li>the error list shows the <em>given key was not present in the dictionary</em> error.</li>
  </ul>
  
  <p>I have defined a user conrtol which I initialize after it has beend loaded using the UserControl_loaded() callback.</p>
  
  <pre><code>    private void UserControl_Loaded(object sender, RoutedEventArgs e)
      {
          if (TraceGroup != TRACE_GROUP.NONE)
          {
              Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString(MyDictionary[TraceGroup].Foreground));
              Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString(MyDictionary[TraceGroup].Background));
              TraceGroupName = Globals.filterGroups[TraceGroup].Name;
          }
      }   
  </code></pre>
  
  <p>The initialization will be base on sone data I'm storing in a dictionary. <br> I assume, the xaml preview runs the UserControl_Loaded() in teh background when it generates the preview of my UI. The error occures, because the used Dictinary in the callback is only filled on startup of the app.<br>
  To get around this issue during preview-generation I have added the check if TraceGroup is defined. <code>if (TraceGroup != TRACE_GROUP.NONE)...</code><br> But that does not solve my problem.
  <br><br>I'm using Visual Studio Professional 2013 and .Net 4.5.50938</p>