2 implementations of IDispatcher
Microsoft.Maui (2)
Dispatching\Dispatcher.cs (1)
6 public partial class Dispatcher : IDispatcher
Dispatching\Dispatcher.Standard.cs (1)
6 public partial class Dispatcher : IDispatcher
63 references to IDispatcher
Microsoft.AspNetCore.Components.WebView.Maui (2)
MauiDispatcher.cs (2)
9 readonly IDispatcher _dispatcher; 11 public MauiDispatcher(IDispatcher dispatcher)
Microsoft.Maui (38)
Dispatching\ApplicationDispatcher.cs (2)
15 public IDispatcher Dispatcher { get; } 17 public ApplicationDispatcher(IDispatcher dispatcher)
Dispatching\Dispatcher.cs (1)
8 public static IDispatcher? GetForCurrentThread() =>
Dispatching\Dispatcher.Standard.cs (1)
28 static IDispatcher? GetForCurrentThreadImplementation() => null;
Dispatching\DispatcherExtensions.cs (14)
8 /// This class provides a set of extension methods that can be used on objects implementing <see cref="IDispatcher"/>. 16 /// <param name="dispatcher">The <see cref="IDispatcher"/> instance this method is called on.</param> 19 public static Task<T> DispatchAsync<T>(this IDispatcher dispatcher, Func<T> func) 42 /// <param name="dispatcher">The <see cref="IDispatcher"/> instance this method is called on.</param> 45 public static Task DispatchAsync(this IDispatcher dispatcher, Action action) => 56 /// <param name="dispatcher">The <see cref="IDispatcher"/> instance this method is called on.</param> 59 public static Task<T> DispatchAsync<T>(this IDispatcher dispatcher, Func<Task<T>> funcTask) 82 /// <param name="dispatcher">The <see cref="IDispatcher"/> instance this method is called on.</param> 85 public static Task DispatchAsync(this IDispatcher dispatcher, Func<Task> funcTask) => 95 /// <param name="dispatcher">The <see cref="IDispatcher"/> instance this method is called on.</param> 97 public static Task<SynchronizationContext> GetSynchronizationContextAsync(this IDispatcher dispatcher) => 101 /// Starts a timer on the specified <see cref="IDispatcher"/> context. 103 /// <param name="dispatcher">The <see cref="IDispatcher"/> instance this method is called on.</param> 108 public static void StartTimer(this IDispatcher dispatcher, TimeSpan interval, Func<bool> callback)
Dispatching\DispatcherProvider.cs (2)
9 static IDispatcher? s_dispatcherInstance; 36 public IDispatcher? GetForCurrentThread() =>
Dispatching\IDispatcherProvider.cs (4)
4 /// A provider that can supply a <see cref="IDispatcher"/> implementation for the current UI thread. 9 /// Gets a <see cref="IDispatcher"/> implementation for the current UI thread. 11 /// <returns>Instance of a <see cref="IDispatcher"/> implementation.</returns> 12 IDispatcher? GetForCurrentThread();
Hosting\Dispatching\AppHostBuilderExtensions.cs (10)
25 builder.Services.TryAddScoped<IDispatcher>((svc) => GetDispatcher(svc, true)); 32 internal static IDispatcher GetRequiredApplicationDispatcher(this IServiceProvider provider) 36 var dispatcher = keyed.GetKeyedService<IDispatcher>(typeof(IApplication)); 46 internal static IDispatcher? GetOptionalApplicationDispatcher(this IServiceProvider provider) 50 var dispatcher = keyed.GetKeyedService<IDispatcher>(typeof(IApplication)); 60 static IDispatcher GetDispatcher(IServiceProvider services, bool fallBackToApplicationDispatcher) 68 var result = Dispatcher.GetForCurrentThread(); 88 _ = services.GetRequiredService<IDispatcher>();
MauiContextExtensions.cs (4)
32 public static IDispatcher GetDispatcher(this IMauiContext mauiContext) => 33 mauiContext.Services.GetRequiredService<IDispatcher>(); 35 public static IDispatcher? GetOptionalDispatcher(this IMauiContext mauiContext) => 36 mauiContext.Services.GetService<IDispatcher>();
Microsoft.Maui.Controls (23)
AnimationExtensions.cs (1)
378 IDispatcher dispatcher = null;
BindableObject.cs (2)
22 IDispatcher _dispatcher; 28 public IDispatcher Dispatcher =>
Device.cs (1)
138 var dispatcher = Application.Current.FindDispatcher();
DispatcherExtensions.cs (15)
11 public static IDispatcher FindDispatcher(this BindableObject? bindableObject) 19 context.Services.GetService<IDispatcher>() is IDispatcher handlerDispatcher) 23 if (Dispatcher.GetForCurrentThread() is IDispatcher globalDispatcher) 30 if (appMauiContext.Services.GetOptionalApplicationDispatcher() is IDispatcher appDispatcherServiceDispatcher) 34 if (appMauiContext.Services.GetService<IDispatcher>() is IDispatcher appHandlerDispatcher) 43 Application.Current?.Dispatcher is IDispatcher appDispatcher) 50 public static void DispatchIfRequired(this IDispatcher? dispatcher, Action action) 63 public static Task DispatchIfRequiredAsync(this IDispatcher? dispatcher, Action action) 77 public static Task DispatchIfRequiredAsync(this IDispatcher? dispatcher, Func<Task> action) 90 static IDispatcher EnsureDispatcher(IDispatcher? dispatcher) 96 if (Dispatcher.GetForCurrentThread() is IDispatcher globalDispatcher) 100 if (Application.Current?.Dispatcher is IDispatcher appDispatcher)
Items\MarshalingObservableCollection.cs (1)
19 readonly IDispatcher _dispatcher;
ListProxy.cs (2)
14 readonly IDispatcher _dispatcher; 32 internal ListProxy(IEnumerable enumerable, int windowSize = int.MaxValue, IDispatcher dispatcher = null)
TypedBinding.cs (1)
505 IDispatcher dispatcher = (sender as BindableObject)?.Dispatcher;