class Hoge : ICommand
{
private bool _IsEnabled;
bool IsEnabled
{
get
{
return _IsEnabled;
}
set
{
if(value!=_IsEnabled)
{
_isEnabled =value;
if(CanExecuteChanged!=null)
{
CanExecuteChanged(this, EventArgs.Empty);
}
}
}
}
bool ICommand.CanExecute(object p)
{
return _isEnabled;
}
}
Y2xhc3MgSG9nZSA6IElDb21tYW5kCnsKICAgIHByaXZhdGUgYm9vbCBfSXNFbmFibGVkOwogICAgCiAgICBib29sIElzRW5hYmxlZAogICAgewogICAgICAgIGdldAogICAgICAgIHsKICAgICAgICAgICAgcmV0dXJuIF9Jc0VuYWJsZWQ7CiAgICAgICAgfQogICAgICAgIHNldAogICAgICAgIHsKICAgICAgICAgICAgaWYodmFsdWUhPV9Jc0VuYWJsZWQpCiAgICAgICAgICAgIHsgCiAgICAgICAgICAgICAgICBfaXNFbmFibGVkID12YWx1ZTsKICAgICAgICAgICAgICAgIGlmKENhbkV4ZWN1dGVDaGFuZ2VkIT1udWxsKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgQ2FuRXhlY3V0ZUNoYW5nZWQodGhpcywgRXZlbnRBcmdzLkVtcHR5KTsgCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gCiAgICAgICAgfQogICAgfQogICAgCiAgICBib29sIElDb21tYW5kLkNhbkV4ZWN1dGUob2JqZWN0IHApCiAgICB7CiAgICAgICAgcmV0dXJuIF9pc0VuYWJsZWQ7CiAgICB9Cn0=