Skip to content

Commit

Permalink
[macOS/iOS] Fix RequestedThemeChanged event (#11199) (#14077)
Browse files Browse the repository at this point in the history
Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
Co-authored-by: Gerald Versluis <gerald.versluis@microsoft.com>
Co-authored-by: Rui Marinho <me@ruimarinho.net>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
  • Loading branch information
6 people committed Mar 20, 2023
1 parent fedd256 commit 4e36cd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using CoreAnimation;
using CoreGraphics;
using Foundation;
using Microsoft.Extensions.DependencyInjection;
using ObjCRuntime;
using UIKit;

Expand Down Expand Up @@ -129,7 +130,13 @@ public override void ViewSafeAreaInsetsDidChange()
LayoutHeader();
}

public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection)
{
base.TraitCollectionDidChange(previousTraitCollection);

var application = _shellContext?.Shell?.FindMauiContext().Services.GetService<IApplication>();
application?.ThemeChanged();
}

void IDisconnectable.Disconnect()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable enable
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
override Microsoft.Maui.Controls.View.ChangeVisualState() -> void
~override Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.TraitCollectionDidChange(UIKit.UITraitCollection previousTraitCollection) -> void
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#nullable enable
*REMOVED*override Microsoft.Maui.Controls.RefreshView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size
override Microsoft.Maui.Controls.View.ChangeVisualState() -> void
~override Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRootRenderer.TraitCollectionDidChange(UIKit.UITraitCollection previousTraitCollection) -> void

0 comments on commit 4e36cd9

Please sign in to comment.