Skip to main content

uno-toolkit-system-theme-helper

Use SystemThemeHelper to detect system theme (light/dark), check if dark mode is active, and set application theme. Provides static methods for theme retrieval and management.

Jump to install

Source facts

Repository
unoplatform/studio
Last source activity
June 9, 2026 at 19:39
Detected SKILL.md language
English
Stars
10
Forks
1

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions ยท Read-only preview
name
uno-toolkit-system-theme-helper
description
Use SystemThemeHelper to detect system theme (light/dark), check if dark mode is active, and set application theme. Provides static methods for theme retrieval and management.
when_to_use
Use when reading or programmatically switching dark / light mode from C# (not the XAML `ThemeResource` lookup path) โ€” detecting the current system theme, setting the application theme at runtime, or toggling between modes.
metadata
{"author":"uno-platform","version":"2.4","category":"toolkit"}
# Uno Toolkit SystemThemeHelper โ€” Agent Skill ## Workflow > **Docs lookup:** call `uno_platform_docs_search(...)` first, then `uno_platform_docs_fetch(sourcePath="โ€ฆ")` using the `sourcePath` field from a result (a relative `.md` path; add the result's `anchor` for a section). Never pass a URL, a `.html` link, or a hand-built path. ### Step 1: Fetch the SystemThemeHelper Documentation ``` uno_platform_docs_search("Uno Toolkit SystemThemeHelper theme light dark mode detect") ``` Primary documentation page: - **SystemThemeHelper**: `external/uno.toolkit.ui/doc/helpers/SystemThemeHelper.md` Fetch the page: ``` uno_platform_docs_fetch(sourcePath="external/uno.toolkit.ui/doc/helpers/SystemThemeHelper.md") ``` ## Key Principles (Stable) - `SystemThemeHelper.GetCurrentOsTheme()` โ€” returns `ApplicationTheme.Light` or `ApplicationTheme.Dark` - `SystemThemeHelper.GetRootTheme(XamlRoot?)` โ€” gets the app theme for a given XamlRoot - `SystemThemeHelper.IsRootInDarkMode(XamlRoot?)` โ€” quick check if dark mode is active - `SystemThemeHelper.SetRootTheme(XamlRoot?, bool)` โ€” set theme (`true` = dark) - `SystemThemeHelper.SetApplicationTheme(XamlRoot?, ElementTheme)` โ€” set theme using ElementTheme enum - **No `ThemeChanged` event exists** โ€” there is no event to subscribe to for theme changes - Namespace: `using Uno.Toolkit.UI;` ## Related Skills - [[uno-themes-semantic-colors-brushes]] โ€” Semantic color palette and brush system
View on GitHub