From 3730d6067fe064d6f80e2de9405065bbcb1c5321 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 2 Oct 2015 16:01:06 +0200 Subject: [PATCH] Add workaround for ReactiveCommand. --- src/Markup/Perspex.Markup/Binding/PropertyAccessorNode.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Markup/Perspex.Markup/Binding/PropertyAccessorNode.cs b/src/Markup/Perspex.Markup/Binding/PropertyAccessorNode.cs index c1a45d8784..3bdfb2ff3a 100644 --- a/src/Markup/Perspex.Markup/Binding/PropertyAccessorNode.cs +++ b/src/Markup/Perspex.Markup/Binding/PropertyAccessorNode.cs @@ -7,6 +7,7 @@ using System.Reactive.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; +using System.Windows.Input; namespace Perspex.Markup.Binding { @@ -107,10 +108,12 @@ namespace Perspex.Markup.Binding { var value = _propertyInfo.GetValue(target); var observable = value as IObservable; + var command = value as ICommand; var task = value as Task; bool set = false; - if (observable != null) + // ReactiveCommand is an IObservable but we want to bind to it, not its value. + if (observable != null && command == null) { CurrentValue = ExpressionValue.None; set = true;