Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining two ObservableAsProperty throws 'InvalidProgramException' #13

Closed
hallsbyra opened this issue Apr 11, 2016 · 1 comment
Closed
Labels

Comments

@hallsbyra
Copy link
Contributor

The code below throws InvalidProgramException when accessing P2. If I make the properties int or Single, it works fine. Just not with doubles.

    class Program
    {
        static void Main(string[] args)
        {
            var vm = new VM();
            Console.WriteLine(vm.P2);
        }
    }

    public class VM : ReactiveObject
    {
        [ObservableAsProperty] public double P1 { get; }
        [ObservableAsProperty] public double P2 { get; }

        public VM()
        {
            Observable.Return(0.0).ToPropertyEx(this, vm => vm.P1);
            this.WhenAnyValue(vm => vm.P1).ToPropertyEx(this, vm => vm.P2);
        }
    }
hallsbyra added a commit to hallsbyra/ReactiveUI.Fody that referenced this issue Apr 11, 2016
@kswoll kswoll added the bug label Apr 14, 2016
@kswoll
Copy link
Owner

kswoll commented Apr 14, 2016

Thanks for the contribution! I'll take a look at this tonight.

@kswoll kswoll closed this as completed in 970cea3 Apr 16, 2016
kswoll pushed a commit that referenced this issue Apr 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants