title: Migrating DispatcherHelper from MVVMLight to Windows Community Toolkit
body: <p>I am working on upgrading .NET 4.5 based WPF application to .Net 6. The current application uses <code>DispatcherHelper</code> which is not available in Windows Community Toolkit. I am unable to find any sample code which can help me to replace it with the ones available in WCT. I want to update the following code block with the one available in Windows Community Toolkit:</p>
  <pre><code>DispatcherHelper.CheckBeginInvokeOnUI(() =&gt;
  {
      this.SelectedControl = new View.MainMenu();
  });
  </code></pre>
  <p>and</p>
  <pre><code>DispatcherHelper.CheckBeginInvokeOnUI(() =&gt;
  {
       this.SelectedControl = new View.Project();
  });
  </code></pre>