From 29be26a88240a0bc2b533dd5096495bac10b5305 Mon Sep 17 00:00:00 2001 From: Andrey Kunchev Date: Fri, 6 Dec 2019 23:48:43 +0200 Subject: [PATCH] add relativepoint tostring --- src/Avalonia.Visuals/RelativePoint.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Avalonia.Visuals/RelativePoint.cs b/src/Avalonia.Visuals/RelativePoint.cs index 2e8fb16bc1..ebd0ba9351 100644 --- a/src/Avalonia.Visuals/RelativePoint.cs +++ b/src/Avalonia.Visuals/RelativePoint.cs @@ -177,5 +177,16 @@ namespace Avalonia unit); } } + + /// + /// Returns a String representing this RelativePoint instance. + /// + /// The string representation. + public override string ToString() + { + return _unit == RelativeUnit.Absolute ? + _point.ToString() : + string.Format(CultureInfo.InvariantCulture, "{0}%, {1}%", _point.X * 100, _point.Y * 100); + } } }