TerminalTheme

StockSharp.Broker.Maui.Terminal.Services

Applies the user's theme choice (0 = System, 1 = Light, 2 = Dark) to the app. Two things have to move together: UserAppTheme drives the app-wide AppThemeBinding styles, while the trading-terminal palette — whose colours are looked up by key both from XAML and from value converters — lives in a merged ResourceDictionary that is swapped between the dark and light variants here.

Methods

Apply
public static void Apply(Application app, int theme)
TerminalTheme.Apply(app, theme)

Apply the persisted theme index: set UserAppTheme and swap the terminal palette.

HookSystemChanges
public static void HookSystemChanges(Application app)
TerminalTheme.HookSystemChanges(app)

Re-sync the palette when the OS theme changes — only meaningful while the user keeps the "System" option, where UserAppTheme stays Unspecified.

ToAppTheme
public static AppTheme ToAppTheme(int theme)
result = TerminalTheme.ToAppTheme(theme)

Maps the stored theme index to a MAUI AppTheme.