Exemplo n.º 1
0
        public void ToReactivePropertySlimAsSynchronizedObservableCase()
        {
            var source = new ReactivePropertySlim <int>(100);
            var target = source.ToReactivePropertySlimAsSynchronized(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);
        }