Skip to content

Commit

Permalink
chore: Keep RegisterForTraitChanges .NET 9 only
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Nov 26, 2024
1 parent 916328f commit e98f10b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Uno.UI/Controls/RootViewController.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ private void Initialize()
.ObserveWillResignActive((sender, args) =>
VisualTreeHelper.CloseLightDismissPopups(WinUICoreServices.Instance.ContentRootCoordinator.CoreWindowContentRoot.XamlRoot));

#if NET9_0_OR_GREATER
// iOS 17+ only
if (UIDevice.CurrentDevice.CheckSystemVersion(17, 0))
{
((IUITraitChangeObservable)this).RegisterForTraitChanges((env, traits) => SystemThemeHelper.RefreshSystemTheme());
}
#endif
}

// This will handle when the status bar is showed / hidden by the system on iPhones
Expand Down

0 comments on commit e98f10b

Please sign in to comment.