Flow.Launcher/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs

31 lines
763 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2020-04-21 09:12:17 +00:00
using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Infrastructure.UserSettings;
2020-04-21 09:12:17 +00:00
namespace Flow.Launcher.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();
}
}
}