You need to extend this class and then override the constructor of base class to apply the new setting which you are trying to set.
Secondly, you need to change this method to use the parameter which is sent from the calling method to properly identify which menu need to be closing assuming parameter is sending the name of the menu
public void CloseMenuCommand(string parameter)
{
Microsoft.Advertising.Controls.MenuService.CloseMenu();
}