public override void Layout(ViewLayoutContext context)
{
Debug.Assert(context != null);
// Validate incoming reference
if (context == null) throw new ArgumentNullException("context");
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
// Do we need to draw the content?
if (_paletteContent.GetContentDraw(State) == InheritBool.True)
{
// Dispose of old memento first
if (_memento != null)
{
_memento.Dispose();
_memento = null;
}
// Ask the renderer to perform any internal laying out calculations and
// store the returned memento ready for whenever a draw is required
_memento = context.Renderer.RenderStandardContent.LayoutContent(context,
ClientRectangle,
_paletteContent,
_values,
Orientation,
State,
DrawContentOnComposition);
}
}