Refactor settings dialog
This commit is contained in:
parent
05c454dce4
commit
2d2907e076
16 changed files with 1222 additions and 1246 deletions
39
Source/LibationAvalonia/ViewModels/Settings/SettingsVM.cs
Normal file
39
Source/LibationAvalonia/ViewModels/Settings/SettingsVM.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using LibationFileManager;
|
||||
|
||||
namespace LibationAvalonia.ViewModels.Settings
|
||||
{
|
||||
internal interface ISettingsDisplay
|
||||
{
|
||||
void LoadSettings(Configuration config);
|
||||
void SaveSettings(Configuration config);
|
||||
}
|
||||
|
||||
public class SettingsVM : ISettingsDisplay
|
||||
{
|
||||
public SettingsVM(Configuration config)
|
||||
{
|
||||
LoadSettings(config);
|
||||
}
|
||||
|
||||
public ImportantSettingsVM ImportantSettings { get; private set; }
|
||||
public ImportSettingsVM ImportSettings { get; private set; }
|
||||
public DownloadDecryptSettingsVM DownloadDecryptSettings { get; private set; }
|
||||
public AudioSettingsVM AudioSettings { get; private set; }
|
||||
|
||||
public void LoadSettings(Configuration config)
|
||||
{
|
||||
ImportantSettings = new ImportantSettingsVM(config);
|
||||
ImportSettings = new ImportSettingsVM(config);
|
||||
DownloadDecryptSettings = new DownloadDecryptSettingsVM(config);
|
||||
AudioSettings = new AudioSettingsVM(config);
|
||||
}
|
||||
|
||||
public void SaveSettings(Configuration config)
|
||||
{
|
||||
ImportantSettings.SaveSettings(config);
|
||||
ImportSettings.SaveSettings(config);
|
||||
DownloadDecryptSettings.SaveSettings(config);
|
||||
AudioSettings.SaveSettings(config);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue