2020-04-06 20:20:45 +02:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using ModernKeePass.Application.Common.Interfaces;
|
2020-04-14 13:44:07 +02:00
|
|
|
using ModernKeePass.Common;
|
2018-03-09 18:06:06 +01:00
|
|
|
|
2020-04-20 20:02:43 +02:00
|
|
|
namespace ModernKeePass.ViewModels.ListItems
|
2018-03-09 18:06:06 +01:00
|
|
|
{
|
|
|
|
public class SettingsSaveVm
|
|
|
|
{
|
2020-04-06 20:20:45 +02:00
|
|
|
private readonly ISettingsProxy _settings;
|
2018-03-09 18:06:06 +01:00
|
|
|
|
2020-04-09 19:43:06 +02:00
|
|
|
public SettingsSaveVm() : this(App.Services.GetRequiredService<ISettingsProxy>())
|
2018-03-09 18:06:06 +01:00
|
|
|
{ }
|
|
|
|
|
2020-04-06 20:20:45 +02:00
|
|
|
public SettingsSaveVm(ISettingsProxy settings)
|
2018-03-09 18:06:06 +01:00
|
|
|
{
|
|
|
|
_settings = settings;
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool IsSaveSuspend
|
|
|
|
{
|
2020-04-14 13:44:07 +02:00
|
|
|
get { return _settings.GetSetting(Constants.Settings.SaveSuspend, true); }
|
|
|
|
set { _settings.PutSetting(Constants.Settings.SaveSuspend, value); }
|
2018-03-09 18:06:06 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|