c# - Reactive Extensions ControlScheduler -
Well, I'm using Reactive Extension Event Handler to handle my app events, I run the headlines on the Yuri thread. I also use ControlSubular for However, recently I am getting cross thread exception despite using control scheduler and I do not know what the problem is.
Code:
Observable.FromEventPattern & Lt; String & gt; (CC, "UiAlertMessage", New Control Session ()) Subscribe (_ = & gt; {Alert Control. (Show this language, title, _.EventArgs.UppercaseFirst ());}); The new control scheduler (this) is not
to run the code on the UI control thread, so I do not get cross threading exceptions?
you should do
Observable.FromEventPattern & lt; String & gt; (CC, "UiAlertMessage"). AboveOption (this). Subscribe (_ = & gt; {Alert Control. (Show this language, Titles, _.EventArgs.UppercaseFirst ());});
This is the standard way of sending a scheduler related to specific controls. Passing control scheduler as you have got subscribed on
membership
by looking at view
Observer
See the inspection
for the difference between SubscribeOn
and carefully system. Reactive .Windows. Force
assembly.
Public stable IObservable & lt; TSource & gt; ObserveOn & LT; TSource & gt; (This IObservable & lt; TSource & gt; source, control control) {If (source == empty) Repeat new logic ("source"); If (control == empty) throw new logic ("control"); Second Synchronization. Observations & lt; TSource & gt; (Source, (iSCd) new control scheduler (control)); }
Comments
Post a Comment