This repository was archived by the owner on May 15, 2024. It is now read-only.

Description
Use Case: Obtaining the main thread for Xamarin Forms UI navigation from a method that may or may not be running in the background thread.
Part of: Platform
API:
- bool IsMainThread { get; }
void NavigationMethod()
{
if (Platform.IsMainThread)
{
Navigate();
}
else
{
Device.BeginInvokeOnMainThread(Navigate());
}
}
Android: Looper.MyLooper == MainLooper
iOS: NSThread.Current.IsMainThread