sharee.bike-App/TINKLib/ViewModel/Settings/LocksServicesViewModel.cs

36 lines
895 B
C#
Raw Normal View History

2021-05-13 20:03:07 +02:00
using System;
using System.ComponentModel;
namespace TINK.ViewModel.Settings
{
2022-09-06 16:08:19 +02:00
/// <summary> Manages locks services and related parameters. </summary>
public class LocksServicesViewModel : INotifyPropertyChanged
{
private TimeSpan ConnectTimeout { get; set; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
public LocksServicesViewModel(
TimeSpan connectTimeout,
ServicesViewModel servicesViewModel)
{
ConnectTimeout = connectTimeout;
Services = servicesViewModel;
}
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
public ServicesViewModel Services { get; }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
public string ConnectTimeoutSecText { get => ConnectTimeout.TotalSeconds.ToString(); }
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
public double ConnectTimeoutSec
{
get => ConnectTimeout.TotalSeconds;
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
set
{
ConnectTimeout = TimeSpan.FromSeconds(value);
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(ConnectTimeoutSecText)));
}
}
2021-05-13 20:03:07 +02:00
2022-09-06 16:08:19 +02:00
public event PropertyChangedEventHandler PropertyChanged;
}
2021-05-13 20:03:07 +02:00
}