mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-23 02:51:26 -07:00
28 lines
695 B
C#
28 lines
695 B
C#
using System.Windows.Input;
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
namespace Bloxstrap.UI.ViewModels.Settings
|
|
{
|
|
public class MainWindowViewModel : NotifyPropertyChangedViewModel
|
|
{
|
|
public ICommand SaveSettingsCommand => new RelayCommand(SaveSettings);
|
|
|
|
public EventHandler? RequestSaveNoticeEvent;
|
|
|
|
private void SaveSettings()
|
|
{
|
|
App.Settings.Save();
|
|
App.State.Save();
|
|
App.FastFlags.Save();
|
|
|
|
foreach (var task in App.PendingSettingTasks)
|
|
task.Value.Execute();
|
|
|
|
App.PendingSettingTasks.Clear();
|
|
|
|
RequestSaveNoticeEvent?.Invoke(this, new EventArgs());
|
|
}
|
|
}
|
|
}
|