private double CalculateVerticalCenterOffset(double initialOffset, double flyoutHeight, double elementHeight)
{
double newY = 0.0;
if (_realizedPlacement == PlacementMode.Top || _realizedPlacement == PlacementMode.Bottom)
{
newY = this.VerticalOffset + initialOffset;
}
else
{
newY = this.VerticalOffset + initialOffset - (flyoutHeight / 2) + (elementHeight / 2);
}
return CalculateGutter(newY);
}