diff --git a/src/Perspex.SceneGraph/Size.cs b/src/Perspex.SceneGraph/Size.cs
index 1e7acc0096..83b49fc0da 100644
--- a/src/Perspex.SceneGraph/Size.cs
+++ b/src/Perspex.SceneGraph/Size.cs
@@ -128,6 +128,28 @@ namespace Perspex
return new Size(size._width - toSubstract._width, size._height - toSubstract._height);
}
+ ///
+ /// Parses a string.
+ ///
+ /// The string.
+ /// The current culture.
+ /// The .
+ public static Size Parse(string s, CultureInfo culture)
+ {
+ var parts = s.Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries)
+ .Select(x => x.Trim())
+ .ToList();
+
+ if (parts.Count == 2)
+ {
+ return new Size(double.Parse(parts[0], culture), double.Parse(parts[1], culture));
+ }
+ else
+ {
+ throw new FormatException("Invalid Size.");
+ }
+ }
+
///
/// Constrains the size.
///