Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 381 Bytes

Nuget.md

File metadata and controls

23 lines (18 loc) · 381 Bytes

Xamarin Main Thread Dispatcher

Examples

Observable
    .Timer(TimeSpan.FromSeconds(2))
    .ObserveOn(XamarinDispatcherScheduler.Current)
    .Subscribe(_ =>
    {
        lblChangeMe.Text = "Changed";
    });
//Helper to check if you're on the main thread
if (!XamarinDispatcherScheduler.OnMainThread())
{
    throw new Exception("Scheduler fail");
}