title: Why is this Observable blocking the WPF GUI thread (C#)?
body: <p>Given: An extension method taking a Selenium IWebdriver instance and returning an IObservable</p>
  
  <pre><code>     public static IObservable&lt;ObservableCollection&lt;WebElementWrapper&gt;&gt; 
        GetAllElementsAsObservable(this IWebDriver wd)
        {
          return Observable.Create&lt;ObservableCollection&lt;WebElementWrapper&gt;&gt;(
               (IObserver&lt;ObservableCollection&lt;WebElementWrapper&gt;&gt; observer) =&gt;
               {                     
                       var eles = wd.FindElements(By.CssSelector("*"));
                       var list = eles.ToWebElementObservableCollection();
                       observer.OnNext(list);
                       observer.OnCompleted();                     
  
                   return Disposable.Create(() =&gt; { });
               });
        }
  </code></pre>
  
  <p>And the code that calls the method above (running on GUI thread)...</p>
  
  <pre><code>                //GUI Will Freeze on this call until OnCompleted is called
                  cd.GetAllElementsAsObservable().Subscribe((WEWList) =&gt;
                  {
                      WebElementCollection = WEWList;
                      SetNavigationItems();
                  });
  </code></pre>
  
  <p>Can anyone help me determine root cause of GUI thread block until OnCompleted is called. I can stop the blocking if I use Task.Run in first method, but then I have to marshall the collection back onto GUI thread.</p>
  
  <p>Does this block because the GUI thread spun up the Webdriver of which the Observable is using to extract elements?  </p>
  
  <p>Or is this due to the static methods being created at start up time on the GUI thread?</p>