Improve WatchProperty

This commit is contained in:
tyrrrz
2026-04-03 00:13:40 +03:00
parent 1f189e5206
commit 295f4cf9a2
4 changed files with 11 additions and 17 deletions

View File

@@ -14,18 +14,12 @@ public partial class LocalizationManager : ObservableObject, IDisposable
public LocalizationManager(SettingsService settingsService)
{
_eventRoot.Add(
settingsService.WatchProperty(
o => o.Language,
() => Language = settingsService.Language,
true
)
);
_eventRoot.Add(settingsService.WatchProperty(o => o.Language, v => Language = v, true));
_eventRoot.Add(
this.WatchProperty(
o => o.Language,
() =>
_ =>
{
foreach (var propertyName in EnglishLocalization.Keys)
OnPropertyChanged(propertyName);