public override Size GetPreferredSize(ViewLayoutContext context)
{
Debug.Assert(context != null);
// Validate incoming reference
if (context == null) throw new ArgumentNullException("context");
// By default we take up no space at all
Size preferredSize = Size.Empty;
// If we have some content to encompass
if (_paletteContent.GetContentDraw(State) == InheritBool.True)
{
// Ask the renderer for the contents preferred size
preferredSize = context.Renderer.RenderStandardContent.GetContentPreferredSize(context,
_paletteContent,
_values,
Orientation,
State,
DrawContentOnComposition);
}
return preferredSize;
}