title: Cannot convert anonymous method to type 'System.Delegate' because it is not a delegate type
body: <p>I want to execute this code on main thread in WPF app and getting error I can't figure out what is wrong:</p>
  
  <pre><code>private void AddLog(string logItem)
          {
  
              this.Dispatcher.BeginInvoke(
                  delegate()
                      {
                          this.Log.Add(new KeyValuePair&lt;string, string&gt;(DateTime.Now.ToLongTimeString(), logItem));
  
                      });
          }
  </code></pre>