public Point GetCenterPos(CardEntity entity, bool top) { var xOffset = entity.ActualWidth / 2; var yOffset = entity.ActualHeight / 2; if (top) { yOffset -= 12; } else { yOffset += 12; yOffset *= -1; } var x = GetPosition(entity).X + xOffset; var y = GetPosition(entity).Y + yOffset; return(new Point(x, y)); }
public Point GetCenterPos(CardEntity entity, bool top) { var xOffset = entity.ActualWidth / 2; var yOffset = entity.ActualHeight / 2; if(top) yOffset -= 12; else { yOffset += 12; yOffset *= -1; } var x = GetPosition(entity).X + xOffset; var y = GetPosition(entity).Y + yOffset; return new Point(x, y); }