[NUI] Add InterceptWheelEvent
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Samples / Tizen.NUI.Samples / Samples / ScrollableFocus / ScrollableFocusSample.cs
index f0a9aed..5a85cdf 100755 (executable)
@@ -9,21 +9,18 @@ namespace Tizen.NUI.Samples
     public class ScrollableFocusSample : IExample
     {
         public View root;
-        public class CustomScrollableBase : ScrollableBase
-        {
-            public override bool OnWheel(Wheel wheel)
-            {
-                base.OnWheel(wheel);
-                Window window = NUIApplication.GetDefaultWindow();
-                window.LazyFeedHover();
-                return true;
-            }
-        }
 
         public void Activate()
         {
             Window window = NUIApplication.GetDefaultWindow();
 
+            // Use LazyFeedHover if you want to trigger the HoverEvent again when a Wheel event is received.
+            window.InterceptWheelEvent += (s, e) =>
+            {
+                window.LazyFeedHover();
+                return false;
+            };
+
             root = new View();
             root.Layout = new AbsoluteLayout();
             root.Size = new Size(500, 800);
@@ -48,7 +45,7 @@ namespace Tizen.NUI.Samples
             };
             root.Add(topbtn);
 
-            var scrollview = new CustomScrollableBase
+            var scrollview = new ScrollableBase
             {
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,
@@ -72,7 +69,7 @@ namespace Tizen.NUI.Samples
             };
             root.Add(middle);
 
-            var myscrollview = new CustomScrollableBase
+            var myscrollview = new ScrollableBase
             {
                 ScrollingDirection = ScrollableBase.Direction.Vertical,
                 WidthSpecification = LayoutParamPolicies.MatchParent,