4 writes to Current
Microsoft.Maui.Controls (3)
Application\Application.cs (3)
81 public static void SetCurrentApplication(Application value) => Current = value; 332 internal static void ClearCurrent() => Current = null; 370 Current = this;
Microsoft.Maui.Controls.Compatibility (1)
Tizen\FormsApplication.cs (1)
100 Application.Current = application;
82 references to Current
Microsoft.Maui.Controls (76)
Application\Application.cs (1)
369 if (Current is null)
AppThemeBinding.cs (1)
164 app = Application.Current;
BindableObject.cs (7)
89 Application.Current?.FindMauiContext()?.CreateLogger<BindableObject>()?.LogWarning($"Cannot set the BindableProperty \"{property.PropertyName}\" because it is readonly."); 103 Application.Current?.FindMauiContext()?.CreateLogger<BindableObject>()?.LogWarning($"Cannot set the BindableProperty \"{property.PropertyName}\" because it is readonly."); 298 Application.Current?.FindMauiContext()?.CreateLogger<BindableObject>()?.LogWarning($"Cannot set the a OneWay Binding \"{targetProperty.PropertyName}\" because it is readonly."); 493 Application.Current?.FindMauiContext()?.CreateLogger<BindableObject>()?.LogWarning($"Cannot set the BindableProperty \"{property.PropertyName}\" because it is readonly."); 521 Application.Current?.FindMauiContext()?.CreateLogger<BindableObject>()?.LogWarning($"Cannot set the BindableProperty \"{property.PropertyName}\" because it is readonly."); 562 Application.Current?.FindMauiContext()?.CreateLogger<BindableObject>()?.LogWarning($"Cannot convert {value} to type '{property.ReturnType}'"); 568 Application.Current?.FindMauiContext()?.CreateLogger<BindableObject>()?.LogWarning($"Value is an invalid value for {property.PropertyName}");
BindableObjectExtensions.cs (3)
167 if (Application.Current.TryGetResource(resourceKey, out outerColor)) 198 if (!Application.Current.TryGetResource(lightResourceKey, out outerLight)) 203 if (!Application.Current.TryGetResource(darkResourceKey, out outerDark))
BindablePropertyConverter.cs (2)
84 Application.Current?.FindMauiContext()?.CreateLogger<BindablePropertyConverter>()?.LogWarning("Can't resolve properties with xml namespace prefix."); 90 Application.Current?.FindMauiContext()?.CreateLogger<BindablePropertyConverter>()?.LogWarning($"Can't resolve {value}. Accepted syntax is Type.PropertyName.");
BindingBase.cs (2)
157 Application.Current?.FindMauiContext()?.CreateLogger<BindingBase>()?.LogWarning("FormatException"); 172 Application.Current?.FindMauiContext()?.CreateLogger<BindingBase>()?.LogWarning("FormatException");
Compatibility\Handlers\Shell\iOS\ShellSearchResultsRenderer.cs (1)
59 Application.Current?.FindMauiContext()?.CreateLogger<ShellSearchResultsRenderer>()?.LogError(TrimmerConstants.SearchHandlerDisplayMemberNameNotSupportedWarning);
Compatibility\iOS\FontNamedSizeService.cs (1)
32 if (Application.Current?.On<PlatformConfiguration.iOS>().GetEnableAccessibilityScalingForNamedFontSizes() == false)
Device.cs (8)
86 Application.Current.FindDispatcher().IsDispatchRequired; 91 Application.Current.FindDispatcher().Dispatch(action); 96 Application.Current.FindDispatcher().DispatchAsync(func); 101 Application.Current.FindDispatcher().DispatchAsync(action); 106 Application.Current.FindDispatcher().DispatchAsync(funcTask); 111 Application.Current.FindDispatcher().DispatchAsync(funcTask); 116 Application.Current.FindDispatcher().GetSynchronizationContextAsync(); 138 var dispatcher = Application.Current.FindDispatcher();
DispatcherExtensions.cs (2)
43 Application.Current?.Dispatcher is IDispatcher appDispatcher) 100 if (Application.Current?.Dispatcher is IDispatcher appDispatcher)
Element\Element.cs (3)
297 Application.Current? 352 Application.Current? 409 Application.Current?.FindMauiContext()?.CreateLogger<Element>()?.LogWarning($"{this} is already a child of {element}. Remove {this} from {element} before adding to {value}.");
Handlers\Items\iOS\ItemsViewLayout.cs (1)
430 Application.Current?.FindMauiContext()?.CreateLogger<ItemsViewLayout>()?.LogWarning(ex, "NSRangeException");
Interactivity\EventTrigger.cs (1)
85 Application.Current?.FindMauiContext()?.CreateLogger<EventTrigger>()?.LogWarning("Cannot attach EventTrigger to {Type}.{Event}. Check if the handler exists and if the signature is right.", bindable.GetType(), Event);
ListView\ListView.cs (2)
638 Application.Current?.FindMauiContext()?.CreateLogger<ListView>()?.LogWarning("GroupHeaderTemplate and GroupDisplayBinding cannot be set at the same time, setting GroupHeaderTemplate to null"); 648 Application.Current?.FindMauiContext()?.CreateLogger<ListView>()?.LogWarning("GroupHeaderTemplate and GroupDisplayBinding cannot be set at the same time, setting GroupDisplayBinding to null");
MergedStyle.cs (1)
49 Application.Current?.FindMauiContext()?.CreateLogger<Style>()?.LogWarning("Style TargetType {FullName} is not compatible with element target type {TargetType}", value.TargetType.FullName, TargetType);
NavigationPage\NavigationPage.cs (2)
241 Application.Current?.FindMauiContext()?.CreateLogger<NavigationPage>()?.LogWarning(e, null); 881 Application.Current?.FindMauiContext()?.CreateLogger<NavigationPage>()?.LogWarning("RemovePage called for CurrentPage object. This can result in undesired behavior, consider calling PopAsync instead.");
NavigationPage\NavigationPage.Legacy.cs (1)
241 Application.Current?.FindMauiContext()?.CreateLogger<NavigationPage>()?.LogWarning("RemovePage called for CurrentPage object. This can result in undesired behavior, consider calling PopAsync instead.");
Platform\GestureManager\GesturePlatformManager.iOS.cs (1)
385 result.ShouldRecognizeSimultaneously = (g, o) => Application.Current?.OnThisPlatform().GetPanGestureRecognizerShouldRecognizeSimultaneously() ?? false;
Platform\iOS\DragAndDropDelegate.cs (1)
309 Application.Current?.FindMauiContext()?.CreateLogger<DropGestureRecognizer>()?.LogWarning(dropExc, "Error sending drop event");
RadioButton\RadioButton.cs (1)
638 Application.Current?.FindMauiContext()?.CreateLogger<RadioButton>()?.LogWarning("Warning - {RuntimePlatform} does not support View as the {PropertyName} property of RadioButton; the return value of the ToString() method will be displayed instead.", DeviceInfo.Platform, ContentProperty.PropertyName);
Registrar.cs (1)
465 fontRegistrar = Application.Current?.FindMauiContext()?.Services?.GetService<IFontRegistrar>();
ResourcesExtensions.cs (3)
70 if (Application.Current != null && ((IResourcesProvider)Application.Current).IsResourcesCreated && Application.Current.Resources.TryGetValue(key, out value))
Shell\BaseShellItem.cs (1)
491 if (Application.Current == null)
Shell\SearchHandler.cs (1)
239 Application.Current.GetDefaultFontSize();
Shell\Shell.cs (12)
956 if (Application.Current is null || Application.Current.Windows.Count == 0) 959 if (Application.Current.Windows.Count == 1) 961 return Application.Current.Windows[0].Page as Shell; 968 foreach (var window in Application.Current.Windows) 1000 throw new InvalidOperationException($"Unable to determine the current Shell instance you want to use. Please access Shell via the Windows property on {Application.Current.GetType()}."); 1169 if (Application.Current != null) 1183 if (Application.Current == null) 1188 Application.Current.RequestedThemeChanged -= OnRequestedThemeChanged; 1191 Application.Current.RequestedThemeChanged += OnRequestedThemeChanged; 1258 Application.Current?.FindMauiContext()?.CreateLogger<Shell>()?.LogWarning(exc, "If you're using hot reload add a route to everything in your shell file"); 1554 Application.Current?.FindMauiContext()?.CreateLogger<Shell>()?.LogWarning(exc, "Failed to Navigate Back");
Shell\ShellContent.cs (1)
99 throw new NotSupportedException($"Shell is currently not compatible with TabbedPage. Please use TabBar, Tab or switch to using NavigationPage for your {Application.Current}.MainPage");
Shell\ShellSection.cs (1)
490 Application.Current?.FindMauiContext()?.CreateLogger<ShellSection>()?.LogWarning("Failed to Create Content For: {route}", route);
StreamWrapper.cs (1)
98 Application.Current?.FindMauiContext()?.CreateLogger<StreamWrapper>()?
TypeConversionHelper.cs (1)
173 Application.Current?.FindMauiContext()?.CreateLogger(nameof(TypeConversionHelper))?.LogWarning(
UriImageSource.cs (2)
75 Application.Current?.FindMauiContext()?.CreateLogger<UriImageSource>()?.LogWarning(ex, "Error getting stream for {Uri}", Uri); 126 Application.Current?.FindMauiContext()?.CreateLogger<UriImageSource>()?.LogWarning(ex, "Error getting stream for {Uri}", Uri);
ViewExtensions.cs (2)
297 if (Application.Current?.FindMauiContext() is IMauiContext applicationMauiContext) 318 return fallbackToAppMauiContext ? Application.Current?.FindMauiContext() : default;
Visuals\VisualMarker.cs (1)
29 var logger = Application.Current?.FindMauiContext()?.CreateLogger<IVisual>();
Visuals\VisualTypeConverter.cs (5)
86 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning("Cannot scan assembly {assembly} for Visual types.", assembly.FullName); 90 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning("Unable to load a dependent assembly for {assembly}. It cannot be scanned for Visual types.", assembly.FullName); 94 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning("Unable to load a dependent assembly for {assembly}. Types cannot be loaded.", assembly.FullName); 146 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning("Unable to register {visualType} please add a public default constructor", visualType.ToString()); 165 Application.Current?.FindMauiContext()?.CreateLogger<IVisual>()?.LogWarning(
Xaml\Diagnostics\BindingDiagnostics.cs (2)
18 Application.Current?.FindMauiContext()?.CreateLogger<BindingDiagnostics>()?.LogWarning(message, messageArgs); 24 Application.Current?.FindMauiContext()?.CreateLogger<BindingDiagnostics>()?.LogWarning(message, messageArgs);
Microsoft.Maui.Controls.Compatibility (3)
Tizen\Platform.cs (1)
209 Application.Current.Dispatcher.Dispatch(() => CurrentPageController?.SendAppearing());
Tizen\Renderers\LayoutRenderer.cs (1)
69 Application.Current.Dispatcher.Dispatch(() => UpdateInputTransparent(false));
Tizen\Renderers\NavigationPageRenderer.cs (1)
84 Application.Current.Dispatcher.Dispatch(() =>
Microsoft.Maui.Controls.Xaml (3)
MarkupExtensions\StaticResourceExtension.cs (3)
75 return Application.Current != null 76 && ((IResourcesProvider)Application.Current).IsResourcesCreated 77 && Application.Current.Resources.TryGetValueAndSource(key, out resource, out resourceDictionary);