1 implementation of IMauiContext
Microsoft.Maui (1)
MauiContext.cs (1)
7 public class MauiContext : IMauiContext
46 references to IMauiContext
Microsoft.Maui (29)
ActivationState.cs (3)
33 public ActivationState(IMauiContext context) 39 public ActivationState(IMauiContext context, IPersistedState state) 45 public IMauiContext Context { get; }
Handlers\Element\ElementHandler.cs (2)
27 public IMauiContext? MauiContext { get; private set; } 35 public virtual void SetMauiContext(IMauiContext mauiContext) =>
Handlers\ElementHandlerExtensions.cs (1)
27 var context = handler.MauiContext ??
Handlers\IElementHandler.cs (2)
13 void SetMauiContext(IMauiContext mauiContext); 52 IMauiContext? MauiContext { get; }
Hosting\ServiceProviderExtensions.cs (2)
10 internal static ILogger<T>? CreateLogger<T>(this IMauiContext context) => 16 internal static ILogger? CreateLogger(this IMauiContext context, string loggerName) =>
IActivationState.cs (1)
5 IMauiContext Context { get; }
ImageSources\ImageSourceExtensions.cs (3)
23 public static void LoadImage(this IImageSource? source, IMauiContext mauiContext, Action<IImageSourceServiceResult<PlatformImage>?>? finished = null) 35 public static Task<IImageSourceServiceResult<PlatformImage>?> GetPlatformImageAsync(this IImageSource? imageSource, IMauiContext mauiContext) 46 public static Task<IImageSourceServiceResult<PlatformImage>?> GetPlatformImageAsync(this IImageSourceService imageSourceService, IImageSource? imageSource, IMauiContext mauiContext)
MauiContextExtensions.cs (8)
29 public static IAnimationManager GetAnimationManager(this IMauiContext mauiContext) => 32 public static IDispatcher GetDispatcher(this IMauiContext mauiContext) => 35 public static IDispatcher? GetOptionalDispatcher(this IMauiContext mauiContext) => 38 public static IMauiContext MakeApplicationScope(this IMauiContext mauiContext, NativeApplication platformApplication) 47 public static IMauiContext MakeWindowScope(this IMauiContext mauiContext, NativeWindow platformWindow, out IServiceScope scope) 84 public static void InitializeScopedServices(this IMauiContext scopedContext)
Platform\ElementExtensions.cs (6)
37 static IElementHandler? CreateTypeWithInjection(this Type viewType, IMauiContext mauiContext) 56 public static IElementHandler ToHandler(this IElement view, IMauiContext context) 125 public static PlatformView ToPlatform(this IElement view, IMauiContext context) 138 static void SetHandler(this BasePlatformType nativeElement, IElement element, IMauiContext context) 162 public static void SetApplicationHandler(this PlatformApplication platformApplication, IApplication application, IMauiContext context) => 165 public static void SetWindowHandler(this PlatformWindow platformWindow, IWindow window, IMauiContext context) =>
Platform\ViewExtensions.cs (1)
43 public static IPlatformViewHandler ToHandler(this IView view, IMauiContext context) =>
Microsoft.Maui.Controls (14)
DispatcherExtensions.cs (2)
18 element.FindMauiContext() is IMauiContext context && 28 app.FindMauiContext() is IMauiContext appMauiContext)
Platform\ModalNavigationManager\ModalNavigationManager.cs (1)
14 IMauiContext WindowMauiContext => _window.MauiContext;
RadioButton\RadioButton.Mapper.cs (1)
10 IMauiContext MauiContext => Handler?.MauiContext ?? throw new InvalidOperationException("MauiContext not set");
Toolbar\Toolbar.Mapper.cs (1)
14 IMauiContext MauiContext => Handler?.MauiContext ?? throw new InvalidOperationException("MauiContext not set");
ViewExtensions.cs (7)
294 if (element.FindMauiContext() is IMauiContext viewMauiContext) 297 if (Application.Current?.FindMauiContext() is IMauiContext applicationMauiContext) 304 internal static IMauiContext RequireMauiContext(this Element element, bool fallbackToAppMauiContext = false) 305 => element.FindMauiContext(fallbackToAppMauiContext) ?? throw new InvalidOperationException($"{nameof(IMauiContext)} not found."); 307 internal static IMauiContext? FindMauiContext(this Element element, bool fallbackToAppMauiContext = false) 503 internal static IMauiContext? GetCurrentlyPresentedMauiContext(this Element element) 514 if (currentPage.Handler?.MauiContext is IMauiContext mauiContext)
Window\Window.cs (2)
316 internal IMauiContext MauiContext => 593 var mauiContext = args?.NewHandler?.MauiContext;
Microsoft.Maui.Controls.Compatibility (1)
Forms.cs (1)
16 internal static IMauiContext MauiContext => throw new NotImplementedException();
Microsoft.Maui.Maps (2)
src\Core\src\Hosting\ServiceProviderExtensions.cs (2)
10 internal static ILogger<T>? CreateLogger<T>(this IMauiContext context) => 16 internal static ILogger? CreateLogger(this IMauiContext context, string loggerName) =>