Skip to content

Commit

Permalink
Fixed #103: Check for CommandParamenter value set instead of non-null…
Browse files Browse the repository at this point in the history
… value

As it currently stands, the InvokeCommandAction.CommandParamenter can
never have a null value as it will make it fallback to the other
approaches, which can raise an InvalidCastException.

A null value should be allowed for the CommandParameter, so instead of
doing a null check, I've replaced it with a property unset check
instead.
  • Loading branch information
pedrolamas committed Jun 21, 2016
1 parent 22e885b commit e71c6d9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public object Execute(object sender, object parameter)
}

object resolvedParameter;
if (this.CommandParameter != null)
if (this.ReadLocalValue(InvokeCommandAction.CommandParameterProperty) != DependencyProperty.UnsetValue)
{
resolvedParameter = this.CommandParameter;
}
Expand Down

0 comments on commit e71c6d9

Please sign in to comment.