使用Objects的ReactiveObject属性

时间:2018-01-17 15:25:51

标签: c# reactive-programming reactiveui

有没有办法在ReactiveUI中使用对象作为属性?

这不起作用:

private Settings settings;
public Settings Settings
{
    get
    {
        return settings;
    }
    set { this.RaiseAndSetIfChanged(ref settings, value); }
}

我在听的时候从未收到变更通知:

this.WhenActivated(
            registerDisposable =>
            {
                registerDisposable(
                        this.WhenAnyValue(x => x.Settings)
                        .SelectMany(async x => await _settingsService.CreateSetting(Settings))
                       .Subscribe());
            });

0 个答案:

没有答案