Added AppSettings
Added AppSettings for FreeTubeSyncer.
This commit is contained in:
parent
ddf50a3052
commit
ec55cf2f11
1 changed files with 27 additions and 0 deletions
27
FreeTubeSyncer/Models/AppSetting.cs
Normal file
27
FreeTubeSyncer/Models/AppSetting.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System.Text.Json.Serialization;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace FreeTubeSyncer.Models;
|
||||
|
||||
public partial class AppSettings : ObservableObject
|
||||
{
|
||||
[ObservableProperty] [property: JsonInclude] private string _restBaseUrl = "http://127.0.0.1:8080";
|
||||
[ObservableProperty] [property: JsonInclude] private int _checkInterval = 30;
|
||||
[ObservableProperty] [property: JsonInclude] private bool _syncHistory = true;
|
||||
[ObservableProperty] [property: JsonInclude] private bool _syncPlaylist = true;
|
||||
[ObservableProperty] [property: JsonInclude] private bool _syncProfile = true;
|
||||
[ObservableProperty] [property: JsonInclude] private bool _syncSearchHistory = true;
|
||||
[ObservableProperty] [property: JsonInclude] private bool _syncSettings = true;
|
||||
[ObservableProperty] [property: JsonIgnore] private bool _settingsDirty = false;
|
||||
|
||||
public AppSettings()
|
||||
{
|
||||
PropertyChanged += (sender, args) =>
|
||||
{
|
||||
if (args.PropertyName == nameof(SettingsDirty))
|
||||
return;
|
||||
|
||||
SettingsDirty = true;
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue