Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/Controls/src/Core/Application/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class Application : Element, IResourcesProvider, IApplicationCont
readonly Lazy<PlatformConfigurationRegistry<Application>> _platformConfigurationRegistry;

#pragma warning disable CS0612 // Type or member is obsolete
readonly Lazy<IResourceDictionary> _systemResources;
readonly Lazy<IResourceDictionary?> _systemResources;
#pragma warning restore CS0612 // Type or member is obsolete

IAppIndexingProvider? _appIndexProvider;
Expand All @@ -40,10 +40,13 @@ internal Application(bool setCurrentApplication)
SetCurrentApplication(this);

#pragma warning disable CS0612 // Type or member is obsolete
_systemResources = new Lazy<IResourceDictionary>(() =>
_systemResources = new Lazy<IResourceDictionary?>(() =>
{
var systemResources = DependencyService.Get<ISystemResourcesProvider>().GetSystemResources();
systemResources.ValuesChanged += OnParentResourcesChanged;
if (systemResources is not null)
{
systemResources.ValuesChanged += OnParentResourcesChanged;
}
return systemResources;
});
#pragma warning restore CS0612 // Type or member is obsolete
Expand Down Expand Up @@ -127,7 +130,7 @@ public Page? MainPage
[EditorBrowsable(EditorBrowsableState.Never)]
public NavigationProxy? NavigationProxy { get; private set; }

internal IResourceDictionary SystemResources => _systemResources.Value;
internal IResourceDictionary? SystemResources => _systemResources.Value;

/// <include file="../../docs/Microsoft.Maui.Controls/Application.xml" path="//Member[@MemberName='SetAppIndexingProvider']/Docs/*" />
[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down