public void Initialise() { if (synchronizationContext != null) { // CheckAccess is performed in here. synchronizationContext.Invoke(LoadCommands); } else { // If no sync context, just go ahead and load them. LoadCommands(); } }
public void ReloadView(Route route) { if (route == null) { return; } using (SoftLock) { if (routeHead == null) { return; } if (SynchronizationContext.IsSynchronized) { ReloadViewInternal(route); } else { SynchronizationContext.Invoke(() => ReloadViewInternal(route)); } } }
/// <summary> /// Dispatches the specified delegate on the main thread. /// </summary> /// <param name="action">The delegate to invoke.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="action"/> is <see langword="null"/>.</exception> /// <seealso cref="InvokeOnMainThread(SendOrPostCallback, object)"/> /// <seealso cref="SendToMainThread(Action)"/> /// <seealso cref="PostToMainThread(Action)"/> public static void InvokeOnMainThread(Action action) { _mainThreadContext.Invoke(action); }