public ViewDrawRibbonGroupColorButton(KryptonRibbon ribbon,
KryptonRibbonGroupColorButton ribbonColorButton,
NeedPaintHandler needPaint)
{
Debug.Assert(ribbon != null);
Debug.Assert(ribbonColorButton != null);
Debug.Assert(needPaint != null);
// Remember incoming references
_ribbon = ribbon;
_ribbonColorButton = ribbonColorButton;
_needPaint = needPaint;
_currentSize = _ribbonColorButton.ItemSizeCurrent;
// Associate this view with the source component (required for design time selection)
Component = _ribbonColorButton;
// Create the different views for different sizes of the button
CreateLargeButtonView();
CreateMediumSmallButtonView();
// Update all views to reflect current button state
UpdateEnabledState();
UpdateCheckedState();
UpdateDropDownState();
UpdateItemSizeState();
// Hook into changes in the ribbon button definition
_ribbonColorButton.PropertyChanged += new PropertyChangedEventHandler(OnButtonPropertyChanged);
}