public ViewDrawRibbonGroupLabel(KryptonRibbon ribbon,
KryptonRibbonGroupLabel ribbonLabel,
NeedPaintHandler needPaint)
{
Debug.Assert(ribbon != null);
Debug.Assert(ribbonLabel != null);
Debug.Assert(needPaint != null);
// Remember incoming references
_ribbon = ribbon;
_ribbonLabel = ribbonLabel;
_needPaint = needPaint;
// Associate this view with the source component (required for design time selection)
Component = _ribbonLabel;
// Give paint delegate to label so its palette changes are redrawn
_ribbonLabel.ViewPaintDelegate = needPaint;
// Create the different views for different sizes of the label
CreateLargeLabelView();
CreateMediumSmallLabelView();
// Update all views to reflect current label state
UpdateEnabledState();
UpdateImageSmallState();
UpdateItemSizeState();
// Hook into changes in the ribbon button definition
_ribbonLabel.PropertyChanged += new PropertyChangedEventHandler(OnLabelPropertyChanged);
}