From 81d0314cbebf52b1b9631ae93e0abfd69ce4550a Mon Sep 17 00:00:00 2001 From: SangHyeon Jade Lee Date: Tue, 16 Mar 2021 14:44:09 +0900 Subject: [PATCH] [NUI] : Add ScrollPosition in ScrollEventArgs for user convenience. Current Position property in ScrollEventArgs is position of ContentContainer which is negative. user controls scrollableBase via ScrollTo and other API with positive position of pan not ContentContainer so user must convert current Position Property to use. By this patch, we provide positive ScrollPosition which represent position of scroll pan, so no need to convert value for using it. --- src/Tizen.NUI.Components/Controls/ScrollableBase.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index b238901..671f8e3 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -31,15 +31,17 @@ namespace Tizen.NUI.Components public class ScrollEventArgs : EventArgs { private Position position; + private Position scrollPosition; /// /// Default constructor. /// - /// Current scroll position + /// Current contianer position /// 8 public ScrollEventArgs(Position position) { this.position = position; + this.scrollPosition = new Position(-position); } /// @@ -53,6 +55,18 @@ namespace Tizen.NUI.Components return position; } } + /// + /// Current scroll position of scrollableBase pan. + /// This is the position in the opposite direction to the current position of ContentContainer. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public Position ScrollPosition + { + get + { + return scrollPosition; + } + } } /// -- 2.7.4