feat: Mostly completed bidirectional binding for settings page and configuration.

This commit is contained in:
real-zony
2024-07-03 23:38:33 +08:00
parent e66ef89e7a
commit 9ab9cd50e2
10 changed files with 74 additions and 30 deletions

View File

@@ -21,14 +21,10 @@ public class GlobalConfigurationViewModel : ViewModelBase
IsSkipExistLyricFiles = globalConfig.IsSkipExistLyricFiles;
IsOnlyOutputTranslation = globalConfig.IsOnlyOutputTranslation;
this.WhenAnyValue(x => x.IsOneLine)
.Subscribe(x => globalConfig.IsOneLine = x);
this.WhenAnyValue(x => x.IsEnableTranslation)
.Subscribe(x => globalConfig.IsEnableTranslation = x);
this.WhenAnyValue(x => x.IsSkipExistLyricFiles)
.Subscribe(x => globalConfig.IsSkipExistLyricFiles = x);
this.WhenAnyValue(x => x.IsOnlyOutputTranslation)
.Subscribe(x => globalConfig.IsOnlyOutputTranslation = x);
SubscribeToProperty(this, x => x.IsOneLine, x => globalConfig.IsOneLine = x);
SubscribeToProperty(this, x => x.IsEnableTranslation, x => globalConfig.IsEnableTranslation = x);
SubscribeToProperty(this, x => x.IsSkipExistLyricFiles, x => globalConfig.IsSkipExistLyricFiles = x);
SubscribeToProperty(this, x => x.IsOnlyOutputTranslation, x => globalConfig.IsOnlyOutputTranslation = x);
}
[Reactive] public bool IsOneLine { get; set; }