/// <summary> /// Initialize a new instance of the ViewDrawRibbonGroupDialogButton class. /// </summary> /// <param name="ribbon">Reference to owning ribbon control.</param> /// <param name="ribbonGroup">Reference to ribbon group this represents.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public ViewDrawRibbonGroupDialogButton(KryptonRibbon ribbon, KryptonRibbonGroup ribbonGroup, NeedPaintHandler needPaint) { Debug.Assert(ribbon != null); Debug.Assert(ribbonGroup != null); // Remember incoming references _ribbon = ribbon; _ribbonGroup = ribbonGroup; // Attach a controller to this element for the pressing of the button DialogLauncherButtonController controller = new DialogLauncherButtonController(ribbon, this, needPaint); controller.Click += new MouseEventHandler(OnClick); MouseController = controller; SourceController = controller; KeyController = controller; }