我有一个静态委托命令。我将一个布尔值传递给构造函数。但是,它会引发运行时异常。
public static class myViewModel
{
public static ICommand myCommand {get; private set;}
static myViewModel
{
//If I change the bool to Object, or to Collection type, no exception assuming that I change myMethod parameter as well to the same type.
myCommand = new DelegateCommand<bool>(myMethod);
}
private static void myMethod (bool myBoolean)
{
//To Do
}
}