Skip to content

Commit

Permalink
chore: Mark methods as obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
morning4coffe-dev committed Jan 27, 2025
1 parent e7ee614 commit 4876508
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Uno.Toolkit.UI/Helpers/SystemThemeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public static ApplicationTheme GetRootTheme(XamlRoot? root)
/// <summary>
/// Get if the application is currently in dark mode.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("IsAppInDarkMode is obsolete. Use IsRootInDarkMode(XamlRoot root) instead.")]
public static bool IsAppInDarkMode()
=> GetRootTheme(GetWindowRoot().XamlRoot) == ApplicationTheme.Dark;

public static bool IsRootInDarkMode(XamlRoot root)
=> GetRootTheme(root) == ApplicationTheme.Dark;

[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("SetApplicationTheme(bool darkMode) is obsolete. Use SetApplicationTheme(XamlRoot? root, ElementTheme theme) instead.")]
public static void SetApplicationTheme(bool darkMode)
=> SetRootTheme(GetWindowRoot().XamlRoot, darkMode);

Expand All @@ -79,6 +79,7 @@ public static void SetApplicationTheme(XamlRoot? root, ElementTheme theme)
}
}

[Obsolete("ToggleApplicationTheme() is obsolete. Use SetApplicationTheme(XamlRoot? root, ElementTheme theme) instead.")]
public static void ToggleApplicationTheme()
=> SetApplicationTheme(darkMode: !IsAppInDarkMode());

Expand Down

0 comments on commit 4876508

Please sign in to comment.