mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
* 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
45 lines
1.1 KiB
C#
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
|
|
}
|
|
}
|