private void SetupSaveWithPropertyChanged() { NGSettings.PropertyChangedAsObservable() .Throttle(TimeSpan.FromSeconds(1)) .Subscribe(e => _ = RankingSettings.Save()); RankingSettings.PropertyChangedAsObservable() .Throttle(TimeSpan.FromSeconds(1)) .Subscribe(e => _ = RankingSettings.Save()); CacheSettings.PropertyChangedAsObservable() .Throttle(TimeSpan.FromSeconds(1)) .Subscribe(e => _ = CacheSettings.Save()); AppearanceSettings.PropertyChangedAsObservable() .Throttle(TimeSpan.FromSeconds(1)) .Subscribe(e => _ = AppearanceSettings.Save()); ActivityFeedSettings.PropertyChangedAsObservable() .Throttle(TimeSpan.FromSeconds(1)) .Subscribe(e => _ = ActivityFeedSettings.Save()); PlayerSettings.PropertyChangedAsObservable() .Throttle(TimeSpan.FromSeconds(1)) .Subscribe(e => _ = PlayerSettings.Save()); new[] { PinSettings.PropertyChangedAsObservable().ToUnit(), PinSettings.Pins.CollectionChangedAsObservable().ToUnit(), PinSettings.Pins.ObserveElementPropertyChanged().ToUnit() } .Merge() .Throttle(TimeSpan.FromSeconds(1)) .Subscribe(pair => _ = PinSettings.Save()); }
public async Task Save() { await RankingSettings.Save(); await PlayerSettings.Save(); await NGSettings.Save(); await CacheSettings.Save(); await PlaylistSettings.Save(); await AppearanceSettings.Save(); }