code: function MenuCommand_activateFlyoutCommand(menuCommand) {
                      // Activates the associated Flyout command and returns a promise once complete.
                      // A command is considered to be activated once the proper CSS class has been applied and its associated flyout has finished showing.
                      return new Promise(function (c, e) {
                          menuCommand = menuCommand.winControl || menuCommand;
                          var subFlyout = menuCommand.flyout;
                          // Flyout may not have processAll'd, so this may be a DOM object
                          if (subFlyout && subFlyout.hidden && subFlyout.show) {
  
                              // Add activation state to the command.
                              _ElementUtilities.addClass(menuCommand.element, _Constants.menuCommandFlyoutActivatedClass);
                              subFlyout.element.setAttribute("aria-expanded", "true");
                              subFlyout.addEventListener("beforehide", function beforeHide() {
                                  // Remove activation state from the command if the flyout is ever hidden.
                                  subFlyout.removeEventListener("beforehide", beforeHide, false);
                                  _ElementUtilities.removeClass(menuCommand.element, _Constants.menuCommandFlyoutActivatedClass);
                                  subFlyout.element.removeAttribute("aria-expanded");
                              }, false);
  
                              subFlyout.addEventListener("aftershow", function afterShow() {
                                  subFlyout.removeEventListener("aftershow", afterShow, false);
  
                                  // We are considered activated once we start showing the flyout.
                                  c();
                              }, false);
  
                              subFlyout.show(menuCommand, "_cascade");
                          } else {
                              // Could not change command to activated state.
                              e();
                          }
                      });
                  }
docs: Statics