using System; using System.ComponentModel; namespace TINK.ViewModel.Settings { /// Manages locks services and related parameters. public class LocksServicesViewModel : INotifyPropertyChanged { private TimeSpan ConnectTimeout { get; set; } public LocksServicesViewModel( TimeSpan connectTimeout, ServicesViewModel servicesViewModel) { ConnectTimeout = connectTimeout; Services = servicesViewModel; } public ServicesViewModel Services { get; } public string ConnectTimeoutSecText { get => ConnectTimeout.TotalSeconds.ToString(); } public double ConnectTimeoutSec { get => ConnectTimeout.TotalSeconds; set { ConnectTimeout = TimeSpan.FromSeconds(value); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ConnectTimeoutSecText))); } } public event PropertyChangedEventHandler PropertyChanged; } }