using System.Windows.Input; using DesktopBot.Models; namespace DesktopBot.ViewModels { /// /// ViewModel per la configurazione dei limiti di logging. /// public class LoggingSettingsViewModel : BaseViewModel { private LoggingConfiguration _config; public LoggingSettingsViewModel(LoggingConfiguration config) { _config = config?.Clone() ?? new LoggingConfiguration(); } /// Numero massimo di elementi nel log del bot. public int MaxBotLogEntries { get => _config.MaxBotLogEntries; set { _config.MaxBotLogEntries = value; OnPropertyChanged(); } } /// Numero massimo di elementi nello storico trade. public int MaxTradeHistoryEntries { get => _config.MaxTradeHistoryEntries; set { _config.MaxTradeHistoryEntries = value; OnPropertyChanged(); } } /// Numero massimo di elementi nel log attività della dashboard. public int MaxActivityLogEntries { get => _config.MaxActivityLogEntries; set { _config.MaxActivityLogEntries = value; OnPropertyChanged(); } } /// Numero massimo di elementi nel log live globale. public int MaxLiveLogEntries { get => _config.MaxLiveLogEntries; set { _config.MaxLiveLogEntries = value; OnPropertyChanged(); } } /// Numero massimo di punti dati nel grafico dei prezzi. public int MaxPriceDataPoints { get => _config.MaxPriceDataPoints; set { _config.MaxPriceDataPoints = value; OnPropertyChanged(); } } /// Restituisce la configurazione modificata. public LoggingConfiguration GetUpdatedConfig() => _config.Clone(); /// Ripristina i valori di default. public void ResetToDefaults() { var defaults = new LoggingConfiguration(); MaxBotLogEntries = defaults.MaxBotLogEntries; MaxTradeHistoryEntries = defaults.MaxTradeHistoryEntries; MaxActivityLogEntries = defaults.MaxActivityLogEntries; MaxLiveLogEntries = defaults.MaxLiveLogEntries; MaxPriceDataPoints = defaults.MaxPriceDataPoints; } } }