DCS/ruiyiweiUX/Assets/Scripts/ViewModels/SettingsViewModel.cs

40 lines
1.3 KiB
C#
Raw Normal View History

2026-06-09 13:59:11 +08:00
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;
}