{"path":"NexusReader.UI.Shared/Services/ThemeService.cs","purpose":"Provides a small UI service that holds theme state (light/dark) and notifies subscribers when the theme is toggled.","classification":{"role":"service","layer":"frontend","confidence":0.8,"evidence":["Service naming pattern","Application/service path heuristic","namespace NexusReader.UI.Shared.Services","class ThemeService implements IThemeService (service contract)","exposes theme state and an event-based ToggleTheme method used by UI layers"]},"className":"ThemeService","methods":[{"name":"ToggleTheme","line":8,"endLine":12,"signature":"() -> Task","purpose":"Toggle the current theme mode and notify subscribers via the OnThemeChanged event.","calls":[{"targetFile":"self","targetMethod":"OnThemeChanged","callLine":11,"paramSummary":"awaits the Func event delegate; no explicit parameters"}],"actions":[{"id":"state-change_10","kind":"mapping","label":"Toggles IsLightMode","line":10,"detail":"IsLightMode = !IsLightMode","visibility":"detail-only","confidence":0.7},{"id":"async-invocation_11","kind":"mapping","label":"Await subscriber tasks","line":11,"detail":"Awaits the Task returned by the event delegate to ensure subscribers complete","visibility":"detail-only","confidence":0.7},{"id":"toggletheme_branch_11_0","kind":"branch","label":"Evaluates branch condition","line":11,"detail":"if (OnThemeChanged != null) await OnThemeChanged();","conditionSummary":"OnThemeChanged != null) await OnThemeChanged(","outcomeLabels":["true","false"],"visibility":"secondary-visible","confidence":0.78},{"id":"guard-clause_11","kind":"guard-clause","label":"Invoke event only if subscribers exist","line":11,"detail":"if (OnThemeChanged != null) await OnThemeChanged();","conditionSummary":"OnThemeChanged != null","outcomeLabels":["invoke-await-subscribers","skip-invocation"],"visibility":"detail-only","confidence":0.7}]}],"types":[{"name":"ThemeService","kind":"model","line":3,"purpose":"A small service class that stores theme state and exposes an event for change notifications.","fields":[{"name":"IsLightMode","type":"bool","required":true,"line":5,"description":"Current theme mode flag; true = light mode, false = dark mode"},{"name":"OnThemeChanged","type":"Func?","required":false,"line":6,"description":"Event/delegate invoked (and awaited) when the theme changes; subscribers react to the change"}]}],"serviceRegistrations":[],"startupActions":[],"dependencies":["NexusReader.UI.Shared/Services/IThemeService.cs"],"patterns":["Observer","Service"],"domainConcepts":["Theme","UI state"],"keyDetails":"Minimal shared UI service used to toggle theme and notify subscribers across UI hosts (WASM, MAUI, server-driven UI).","orchestrationMethods":[{"name":"ToggleTheme","line":8,"confidence":0.65,"reason":"Contains 1 architectural actions relevant to business execution.","actionKinds":["mapping","branch","guard-clause"],"evidencePaths":["NexusReader.UI.Shared/Services/ThemeService.cs","self"]}],"typedContracts":[{"name":"ThemeService","kind":"model","line":3,"fieldCount":2,"evidencePaths":["NexusReader.UI.Shared/Services/ThemeService.cs"]}],"persistenceInteractions":[],"externalInteractions":[],"evidenceAnchors":[{"kind":"orchestration-method","label":"ToggleTheme","line":8,"summary":"Contains 1 architectural actions relevant to business execution.","confidence":0.65,"evidencePaths":["NexusReader.UI.Shared/Services/ThemeService.cs","self"]},{"kind":"typed-contract","label":"ThemeService","line":3,"summary":"model with 2 fields.","confidence":0.8,"evidencePaths":["NexusReader.UI.Shared/Services/ThemeService.cs"]}]}