Flow.Launcher/Plugins/Wox.Plugin.Calculator/ViewModels/SettingsViewModel.cs
2020-02-26 20:46:27 +01:00

30 lines
733 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wox.Infrastructure.Storage;
using Wox.Infrastructure.UserSettings;
namespace Wox.Plugin.Caculator.ViewModels
{
public class SettingsViewModel : BaseModel, ISavable
{
private readonly PluginJsonStorage<Settings> _storage;
public SettingsViewModel()
{
_storage = new PluginJsonStorage<Settings>();
Settings = _storage.Load();
}
public Settings Settings { get; set; }
public IEnumerable<int> MaxDecimalPlacesRange => Enumerable.Range(1, 20);
public void Save()
{
_storage.Save();
}
}
}