SetFont
(
Typeface typeface,
Double labelEmSize
)
{
Debug.Assert(typeface != null);
Debug.Assert(labelEmSize > 0);
AssertValid();
m_oXAxis.SetFont(typeface, labelEmSize);
m_oYAxis.SetFont(typeface, labelEmSize);
if (this.ShowAxes)
{
// The Axis objects size themselves based on their font, so the
// Grid needs to resize its rows and columns. For some reason,
// InvalidateArrange() won't do this, so force a resize by
// temporarily resizing one of the Grid's rows.
RowDefinition oSecondRowDefinition = this.RowDefinitions[1];
oSecondRowDefinition.Height = new GridLength(1);
oSecondRowDefinition.Height = GridLength.Auto;
}
}