WPF and NotifyPropertyChanged from a different thread
<p>I'm quite expierenced with WPF but there is one thing that bothers me. I'm using ReactiveUI for raising INotifyPropertyChanged events. I've got two places similiar to this:</p>

<pre><code> public UiModel UiModel
            {
                get { return _uiModel; }
                set { this.RaiseAndSetIfChanged(ref _uiModel, value); }
            }

    public void Run()
    {
      UiModel = GetUIModel();
    }
</code></pre>

<p>where <code>Run()</code> is called like this <code>await Task.Run(()=&gt;Run());</code> and <code>UiModel</code> is bound in <code>XAML</code>.
So what basically should happen -> it should throw a cross-threading exception if <code>Run()</code> function is invoked on a different thread, shouldn't it? I've two places in the code and in one place it always throws an exception and in the second place exception is never thrown. I've compared thread IDs and in both places <code>Run()</code> is run not on UI thread. Why is this the case?
In place where it doesn't throw exceptions I bind it to Dependency Property in UserControl and in the second place I bind it using normal binding</p>

<p>Exception being thrown: <code>{"The calling thread cannot access this object because a different thread owns it."}</code></p>

<p>It looks like moreless I've found the answer for this specific situation. The exception is not thrown by UiModel and it's binding, but UiModel is also used in ReactiveUI validation. If I don't update it from UI it will try to update CanExecuteChanged from a different thread causing that exception. Nevertheless my question remains the same - why can I Update UI from a different thread without cross threading exception? I can't see dispatcher calls in ReactiveUI PropertyChanged invocation.</p>