public override void RenderBefore(RenderContext context)
{
int memento;
// Find the correct palette to use that matches the button state
switch (State)
{
default:
case PaletteState.Normal:
memento = 0;
break;
case PaletteState.Tracking:
memento = 1;
break;
case PaletteState.Tracking | PaletteState.FocusOverride:
memento = 2;
break;
case PaletteState.Pressed:
memento = 3;
break;
}
// Draw the background
_mementos[memento] = context.Renderer.RenderRibbon.DrawRibbonApplicationTab(_ribbon.RibbonShape, context, ClientRectangle, State,
_ribbon.RibbonAppButton.AppButtonBaseColorDark,
_ribbon.RibbonAppButton.AppButtonBaseColorLight,
_mementos[memento]);
}