40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
|
|
using System;
|
||
|
|
|
||
|
|
public class SettingsViewModel
|
||
|
|
{
|
||
|
|
public float Brightness
|
||
|
|
{
|
||
|
|
get => ServiceLocator.Get<ISystemSettingsService>()?.Brightness ?? 50f;
|
||
|
|
set { var s = ServiceLocator.Get<ISystemSettingsService>(); if (s != null) s.Brightness = value; }
|
||
|
|
}
|
||
|
|
|
||
|
|
public int Volume
|
||
|
|
{
|
||
|
|
get => ServiceLocator.Get<ISystemSettingsService>()?.Volume ?? 50;
|
||
|
|
set { var s = ServiceLocator.Get<ISystemSettingsService>(); if (s != null) s.Volume = value; }
|
||
|
|
}
|
||
|
|
|
||
|
|
public int MuteDurationMinutes
|
||
|
|
{
|
||
|
|
get => ServiceLocator.Get<ISystemSettingsService>()?.MuteDurationMinutes ?? 3;
|
||
|
|
set { var s = ServiceLocator.Get<ISystemSettingsService>(); if (s != null) s.MuteDurationMinutes = value; }
|
||
|
|
}
|
||
|
|
|
||
|
|
public DateTime SystemTime
|
||
|
|
{
|
||
|
|
get => ServiceLocator.Get<ISystemSettingsService>()?.SystemTime ?? DateTime.Now;
|
||
|
|
set { var s = ServiceLocator.Get<ISystemSettingsService>(); if (s != null) s.SystemTime = value; }
|
||
|
|
}
|
||
|
|
|
||
|
|
public NetworkConfig Network
|
||
|
|
{
|
||
|
|
get => ServiceLocator.Get<ISystemSettingsService>()?.Network ?? default;
|
||
|
|
set { var s = ServiceLocator.Get<ISystemSettingsService>(); if (s != null) s.Network = value; }
|
||
|
|
}
|
||
|
|
|
||
|
|
public string VersionShort => ServiceLocator.Get<ISystemSettingsService>()?.VersionShort;
|
||
|
|
public string VersionFull => ServiceLocator.Get<ISystemSettingsService>()?.VersionFull;
|
||
|
|
}
|
||
|
|
|
||
|
|
|