@page "/settings" @using TradingBot.Services @using TradingBot.Models @inject SettingsService SettingsService @implements IDisposable @rendermode InteractiveServer Impostazioni - TradingBot

Generale

Modalità Simulazione
Utilizza dati simulati invece di dati reali di mercato
Notifiche Desktop
Ricevi notifiche per operazioni importanti

Trading

Auto-Start Bot
Avvia automaticamente il bot all'apertura dell'applicazione
Conferma Operazioni Manuali
Richiedi conferma prima di eseguire operazioni manuali

Avanzate

Intervallo Aggiornamento
Frequenza di aggiornamento dei dati di mercato
Log Level
Livello di dettaglio dei log di sistema
@if (showNotification) {
Impostazioni salvate con successo!
}
@code { private AppSettings settings = new(); private bool showNotification = false; protected override void OnInitialized() { settings = SettingsService.GetSettings(); SettingsService.OnSettingsChanged += HandleSettingsChanged; } private void UpdateSetting(string propertyName, T value) { SettingsService.UpdateSetting(propertyName, value); settings = SettingsService.GetSettings(); ShowNotification(); } private void SaveSettings() { SettingsService.UpdateSettings(settings); ShowNotification(); } private void ResetToDefaults() { SettingsService.ResetToDefaults(); settings = SettingsService.GetSettings(); ShowNotification(); } private async void ShowNotification() { showNotification = true; StateHasChanged(); await Task.Delay(3000); showNotification = false; StateHasChanged(); } private void HandleSettingsChanged() { settings = SettingsService.GetSettings(); InvokeAsync(StateHasChanged); } public void Dispose() { SettingsService.OnSettingsChanged -= HandleSettingsChanged; } }