private HorizontalAlignment GetHorizontalAlignment (ContentAlignment align)
{
switch (align) {
case ContentAlignment.BottomLeft:
case ContentAlignment.MiddleLeft:
case ContentAlignment.TopLeft:
return HorizontalAlignment.Left;
case ContentAlignment.BottomCenter:
case ContentAlignment.MiddleCenter:
case ContentAlignment.TopCenter:
return HorizontalAlignment.Center;
case ContentAlignment.BottomRight:
case ContentAlignment.MiddleRight:
case ContentAlignment.TopRight:
return HorizontalAlignment.Right;
}
return HorizontalAlignment.Left;
}