teamsiso/src/TeamsISO.App.WinUI/Services
Zac Gaetano f7249c31c2
Some checks failed
CI / build-and-test (push) Failing after 26s
feat(winui3): persist theme preference to UIPreferences
Services/UIPreferences.cs — mirror of the WPF host's UIPreferences,
sharing %LOCALAPPDATA%\TeamsISO\ui-prefs.json on disk. Adds a Theme
field ("System" / "Dark" / "Light") that the WPF host's UIPreferences
will pick up when its theme system lands (JSON deserialization is
forward-compatible — extra fields are ignored, missing fields fall
back to defaults).

ThemeManager hydration:
  * Constructor reads UIPreferences.Theme on first .Current access.
  * Defaults to "System" when the file is missing, the value is
    invalid, or load throws (defensive — ThemeManager.Current is a
    static singleton, a throw would break theme resolution app-wide).
ThemeManager.Set persistence:
  * Calls UIPreferences.SetTheme(preference) which does a read-modify-
    write of the JSON (so other fields aren't trampled).
  * Persistence is best-effort wrapped in try/catch — disk full,
    permission denied, etc. fall through and the in-memory state still
    holds for the session.

End-to-end now: title-bar sun/moon toggle → ThemeManager.Toggle →
.Set("Dark"/"Light") → JSON write → next launch reads the preference
and applies before the first frame. Operator's theme choice survives
across launches and across host swaps once the WPF host learns the
field.
2026-05-13 21:35:31 -04:00
..
TeamsControlBridge.cs feat(winui3): wire Teams orchestration into the in-call bar + rail buttons 2026-05-13 21:31:04 -04:00
TeamsLauncher.cs feat(winui3): wire Teams orchestration into the in-call bar + rail buttons 2026-05-13 21:31:04 -04:00
ThemeManager.cs feat(winui3): persist theme preference to UIPreferences 2026-05-13 21:35:31 -04:00
UIPreferences.cs feat(winui3): persist theme preference to UIPreferences 2026-05-13 21:35:31 -04:00