void IActionContainer.Register(ActionBase action)
 {
     SingleChoiceAction singleChoiceAction = action as SingleChoiceAction;
     if (singleChoiceAction != null && singleChoiceAction.Controller is MenuController)
     {
         this.action = singleChoiceAction;
         this.menuController = (singleChoiceAction.Controller as MenuController);
         this.menuController.ItemsInitialized += new EventHandler<EventArgs>(this.menuController_ItemsInitialized);
     }
 }
 protected override void OnWindowChanging(Window window)
 {
     base.OnWindowChanging(window);
     if (!window.IsMain)
     {
         return;
     }
     this.menuController = base.Frame.GetController<MenuController>();
     if (this.menuController != null)
     {
         this.menuController.Activated += new EventHandler(this.controller_Activated);
         this.menuController.Deactivated += new EventHandler(this.controller_Deactivated);
     }
 }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.menuController != null)
         {
             this.menuController.Activated -= new EventHandler(this.controller_Activated);
             this.menuController.Deactivated -= new EventHandler(this.controller_Deactivated);
         }
         this.menuController = null;
     }
     base.Dispose(disposing);
 }
 protected override void Dispose(bool disposing)
 {
     if (this.menuController != null)
     {
         this.menuController.ItemsInitialized -= new EventHandler<EventArgs>(this.menuController_ItemsInitialized);
         this.menuController = null;
     }
     if (disposing && this.components != null)
     {
         this.components.Dispose();
     }
     base.Dispose(disposing);
 }