private void OnRelocateRequested(object sender, EventArgs e)
{
double oLeft = _mainWindow.Left;
double oTop = _mainWindow.Top;
double oWidth = _mainWindow.Width;
double oHeight = _mainWindow.Height;
switch (Layout.RelativePosition)
{
case RelativePosition.None:
return;
case RelativePosition.RightTop:
Left = oLeft + oWidth;
Top = oTop + oHeight * 0.5 - Height;
return;
case RelativePosition.LeftTop:
Left = oLeft - Width;
Top = oTop + oHeight * 0.5 - Height;
return;
case RelativePosition.RightBottom:
Left = oLeft + oWidth;
Top = oTop + oHeight * 0.5;
return;
case RelativePosition.LeftBottom:
Left = oLeft - Width;
Top = oTop + oHeight * 0.5;
return;
default:
return;
}
}
}