public void ToReactivePropertyAsSynchronizedObservableCase() { var source = new ReactivePropertySlim <int>(100); var target = source.ToReactivePropertyAsSynchronized(x => x.Value, ox => ox.Select(x => x.ToString()), ox => ox.Where(x => int.TryParse(x, out _)).Select(x => int.Parse(x))); target.Value.Is("100"); target.Value = "10"; source.Value.Is(10); target.Value = "xxx"; source.Value.Is(10); }
public void ToReactivePropertyAsSynchronizedObservableWithIgnoreValidationErrorValueCase() { var source = new ReactivePropertySlim <int>(100); var target = source.ToReactivePropertyAsSynchronized(x => x.Value, ox => ox.Select(x => x.ToString()), ox => ox.Select(x => int.Parse(x)), ignoreValidationErrorValue: true); target.SetValidateNotifyError(x => int.TryParse(x, out _) ? null : "Error"); target.Value.Is("100"); target.Value = "10"; source.Value.Is(10); target.Value = "xxx"; source.Value.Is(10); }