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

36 lines
901 B
C#
Raw Permalink Normal View History

2021-05-13 20:03:07 +02:00
using System;
using System.ComponentModel;
2024-04-09 12:53:23 +02:00
namespace ShareeBike.ViewModel.Settings
2021-05-13 20:03:07 +02:00
{
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
}