Nullable<T> not supported as CommandParameter


The RelayCommand<T> object does not support Nullable<T> as generic type.
See the question / answer on StackOverflow and the code snippet that causes the issue.

The problem is that in the Execute method of RelayCommand<T>, the parameter type is compared to generic type T. Because the return value of GetType() of a Nullable<T> returns T, the parameter is converter in the Execute method. This causes the following exception:

System.InvalidCastException: Invalid cast from 'System.Boolean' to 'System.Nullable`1[[System.Boolean, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.