private static bool ValidateAspectRatio(object value) { if (!(value is double)) { return false; } var aspectRatio = (double) value; return aspectRatio > 0 && !double.IsInfinity(aspectRatio) && !double.IsNaN(aspectRatio); }