Files
PowerToys/src/modules/launcher/Wox/ViewModel/SettingWindowViewModel.cs
Divyansh Srivastava 74412766fa Remove redundant code from Wox project (#4878)
* Removed unnecessary files from wox

Removed themes, images and unused xaml files

* Removed unused functions from settings view model

* Removed update manager

* Cleaned helper class

* Delete SingletonWindowOpener.cs

* nit fixes
2020-07-14 09:05:21 -07:00

45 lines
1.1 KiB
C#

using Wox.Core.Resource;
using Wox.Infrastructure.Storage;
using Wox.Infrastructure.UserSettings;
using Wox.Plugin;
namespace Wox.ViewModel
{
public class SettingWindowViewModel : BaseModel
{
private readonly WoxJsonStorage<Settings> _storage;
public SettingWindowViewModel()
{
_storage = new WoxJsonStorage<Settings>();
Settings = _storage.Load();
Settings.PropertyChanged += (s, e) =>
{
if (e.PropertyName == nameof(Settings.ActivateTimes))
{
OnPropertyChanged(nameof(ActivatedTimes));
}
};
}
public Settings Settings { get; set; }
public void Save()
{
_storage.Save();
}
#region general
private Internationalization _translater => InternationalizationManager.Instance;
#endregion
#region about
public string ActivatedTimes => string.Format(_translater.GetTranslation("about_activate_times"), Settings.ActivateTimes);
#endregion
}
}