The OnClientCommand event will fires when the commands Pin, Reload, Minimize and Maximize are executed (when
the user presses a titlebar button).
Its event arguments object provides the get_commandName()
method which returns the name of the command that was just fired. Please have a look into the sample code snippet which works as expected.