You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the "Implementing search with ObservableAsPropertyHelper" blog post it's stated
One of the cool things about ObservableAsPropertyHelper, is that it guarantees that it will run notifications on the UI thread via the Dispatcher so that you don’t have to think about what thread the observable notification came in on.
When I use the following code
_CurrentCustomer = new ObservableAsPropertyHelper(currentNameObservable, _ => this.RaisePropertyChanged("CurrentCustomer"));
I get a System.UnauthorizedAccessException("Invalid cross-thread access.") in ReactiveObject.RaisePropertyChanged(string propertyName) every time currentNameObservable raises a new value.
The problem seems to be that the default IScheduler for ObservableAsPropertyHelper is not the Dispatcher. At the end of the RxApp static constructor you have
In the "Implementing search with ObservableAsPropertyHelper" blog post it's stated
One of the cool things about ObservableAsPropertyHelper, is that it guarantees that it will run notifications on the UI thread via the Dispatcher so that you don’t have to think about what thread the observable notification came in on.
When I use the following code
_CurrentCustomer = new ObservableAsPropertyHelper(currentNameObservable, _ => this.RaisePropertyChanged("CurrentCustomer"));
I get a System.UnauthorizedAccessException("Invalid cross-thread access.") in ReactiveObject.RaisePropertyChanged(string propertyName) every time currentNameObservable raises a new value.
The problem seems to be that the default IScheduler for ObservableAsPropertyHelper is not the Dispatcher. At the end of the RxApp static constructor you have
if (InUnitTestRunner())
{
//...
}
else
{
DeferredScheduler = Scheduler.Dispatcher;
}
if SILVERLIGHT
else
endif
which resets the DeferredScheduler for Silverlight to Scheduler.ThreadPool. I'm guessing that assignment for #if SILVERLIGHT should have been
The text was updated successfully, but these errors were encountered: