有没有办法在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());
});