2 * Copyright(c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21 using Tizen.NUI.Binding;
23 namespace Tizen.NUI.UIComponents
26 /// The ScrollBar is a UI component that can be linked to the scrollable objects
27 /// indicating the current scroll position of the scrollable object.<br />
29 /// <since_tizen> 3 </since_tizen>
30 public class ScrollBar : View
32 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
33 [EditorBrowsable(EditorBrowsableState.Never)]
34 public static readonly BindableProperty ScrollDirectionProperty = BindableProperty.Create("ScrollDirection", typeof(Direction), typeof(ScrollBar), Direction.Vertical, propertyChanged: (bindable, oldValue, newValue) =>
36 var scrollBar = (ScrollBar)bindable;
37 string valueToString = "";
40 switch ((Direction)newValue)
42 case Direction.Vertical: { valueToString = "Vertical"; break; }
43 case Direction.Horizontal: { valueToString = "Horizontal"; break; }
44 default: { valueToString = "Vertical"; break; }
46 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_DIRECTION, new Tizen.NUI.PropertyValue(valueToString));
49 defaultValueCreator: (bindable) =>
51 var scrollBar = (ScrollBar)bindable;
53 if (Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_DIRECTION).Get(out temp) == false)
55 NUILog.Error("ScrollDirection get error!");
60 case "Vertical": return Direction.Vertical;
61 case "Horizontal": return Direction.Horizontal;
62 default: return Direction.Vertical;
65 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
66 [EditorBrowsable(EditorBrowsableState.Never)]
67 public static readonly BindableProperty IndicatorHeightPolicyProperty = BindableProperty.Create("IndicatorHeightPolicy", typeof(IndicatorHeightPolicyType), typeof(ScrollBar), IndicatorHeightPolicyType.Variable, propertyChanged: (bindable, oldValue, newValue) =>
69 var scrollBar = (ScrollBar)bindable;
70 string valueToString = "";
73 switch ((IndicatorHeightPolicyType)newValue)
75 case IndicatorHeightPolicyType.Variable: { valueToString = "Variable"; break; }
76 case IndicatorHeightPolicyType.Fixed: { valueToString = "Fixed"; break; }
77 default: { valueToString = "Variable"; break; }
79 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Tizen.NUI.PropertyValue(valueToString));
82 defaultValueCreator: (bindable) =>
84 var scrollBar = (ScrollBar)bindable;
86 if (Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HEIGHT_POLICY).Get(out temp) == false)
88 NUILog.Error("IndicatorHeightPolicy get error!");
93 case "Variable": return IndicatorHeightPolicyType.Variable;
94 case "Fixed": return IndicatorHeightPolicyType.Fixed;
95 default: return IndicatorHeightPolicyType.Variable;
98 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
99 [EditorBrowsable(EditorBrowsableState.Never)]
100 public static readonly BindableProperty IndicatorFixedHeightProperty = BindableProperty.Create("IndicatorFixedHeight", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
102 var scrollBar = (ScrollBar)bindable;
103 if (newValue != null)
105 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
108 defaultValueCreator: (bindable) =>
110 var scrollBar = (ScrollBar)bindable;
112 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_FIXED_HEIGHT).Get(out temp);
115 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
116 [EditorBrowsable(EditorBrowsableState.Never)]
117 public static readonly BindableProperty IndicatorShowDurationProperty = BindableProperty.Create("IndicatorShowDuration", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
119 var scrollBar = (ScrollBar)bindable;
120 if (newValue != null)
122 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_SHOW_DURATION, new Tizen.NUI.PropertyValue((float)newValue));
125 defaultValueCreator: (bindable) =>
127 var scrollBar = (ScrollBar)bindable;
129 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_SHOW_DURATION).Get(out temp);
132 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
133 [EditorBrowsable(EditorBrowsableState.Never)]
134 public static readonly BindableProperty IndicatorHideDurationProperty = BindableProperty.Create("IndicatorHideDuration", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
136 var scrollBar = (ScrollBar)bindable;
137 if (newValue != null)
139 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HIDE_DURATION, new Tizen.NUI.PropertyValue((float)newValue));
142 defaultValueCreator: (bindable) =>
144 var scrollBar = (ScrollBar)bindable;
146 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HIDE_DURATION).Get(out temp);
149 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
150 [EditorBrowsable(EditorBrowsableState.Never)]
151 public static readonly BindableProperty ScrollPositionIntervalsProperty = BindableProperty.Create("ScrollPositionIntervals", typeof(PropertyArray), typeof(ScrollBar), new PropertyArray(), propertyChanged: (bindable, oldValue, newValue) =>
153 var scrollBar = (ScrollBar)bindable;
154 if (newValue != null)
156 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Tizen.NUI.PropertyValue((PropertyArray)newValue));
159 defaultValueCreator: (bindable) =>
161 var scrollBar = (ScrollBar)bindable;
162 Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray();
163 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_POSITION_INTERVALS).Get(temp);
166 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
167 [EditorBrowsable(EditorBrowsableState.Never)]
168 public static readonly BindableProperty IndicatorMinimumHeightProperty = BindableProperty.Create("IndicatorMinimumHeight", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
170 var scrollBar = (ScrollBar)bindable;
171 if (newValue != null)
173 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue));
176 defaultValueCreator: (bindable) =>
178 var scrollBar = (ScrollBar)bindable;
180 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT).Get(out temp);
183 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
184 [EditorBrowsable(EditorBrowsableState.Never)]
185 public static readonly BindableProperty IndicatorStartPaddingProperty = BindableProperty.Create("IndicatorStartPadding", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
187 var scrollBar = (ScrollBar)bindable;
188 if (newValue != null)
190 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_START_PADDING, new Tizen.NUI.PropertyValue((float)newValue));
193 defaultValueCreator: (bindable) =>
195 var scrollBar = (ScrollBar)bindable;
197 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_START_PADDING).Get(out temp);
200 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
201 [EditorBrowsable(EditorBrowsableState.Never)]
202 public static readonly BindableProperty IndicatorEndPaddingProperty = BindableProperty.Create("IndicatorEndPadding", typeof(float), typeof(ScrollBar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
204 var scrollBar = (ScrollBar)bindable;
205 if (newValue != null)
207 Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_END_PADDING, new Tizen.NUI.PropertyValue((float)newValue));
210 defaultValueCreator: (bindable) =>
212 var scrollBar = (ScrollBar)bindable;
214 Tizen.NUI.Object.GetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_END_PADDING).Get(out temp);
218 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
220 private EventHandler<PanFinishedEventArgs> _scrollBarPanFinishedEventHandler;
221 private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate;
223 private EventHandler<ScrollIntervalEventArgs> _scrollBarScrollPositionIntervalReachedEventHandler;
224 private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate;
227 /// Creates an initialized scrollbar.
229 /// <param name="direction">The direction of the scrollbar (either vertically or horizontally).</param>
230 /// <since_tizen> 3 </since_tizen>
231 public ScrollBar(ScrollBar.Direction direction) : this(Interop.ScrollBar.ScrollBar_New__SWIG_0((int)direction), true)
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
237 /// Creates an uninitialized scrollbar.
239 /// <since_tizen> 3 </since_tizen>
240 public ScrollBar() : this(Interop.ScrollBar.ScrollBar_New__SWIG_1(), true)
242 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245 internal ScrollBar(ScrollBar scrollBar) : this(Interop.ScrollBar.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true)
247 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.ScrollBar.ScrollBar_SWIGUpcast(cPtr), cMemoryOwn)
252 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
255 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
256 private delegate void PanFinishedEventCallbackDelegate();
258 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
259 private delegate void ScrollPositionIntervalReachedEventCallbackDelegate(float position);
262 /// The event emitted when panning is finished on the scroll indicator.
264 /// <remarks>Event only emitted when the source of the scroll position properties are set.</remarks>
265 /// <since_tizen> 3 </since_tizen>
266 public event EventHandler<PanFinishedEventArgs> PanFinished
270 if (_scrollBarPanFinishedEventHandler == null)
272 _scrollBarPanFinishedEventCallbackDelegate = (OnScrollBarPanFinished);
273 PanFinishedSignal().Connect(_scrollBarPanFinishedEventCallbackDelegate);
275 _scrollBarPanFinishedEventHandler += value;
279 _scrollBarPanFinishedEventHandler -= value;
280 if (_scrollBarPanFinishedEventHandler == null && PanFinishedSignal().Empty() == false)
282 PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
288 /// This is the event emitted when the current scroll position of the scrollable content goes above or below the values specified by ScrollPositionIntervals property.
290 /// <remarks>Event only emitted when the source of the scroll position properties are set.</remarks>
291 /// <since_tizen> 3 </since_tizen>
292 public event EventHandler<ScrollIntervalEventArgs> ScrollInterval
296 if (_scrollBarScrollPositionIntervalReachedEventHandler == null)
298 _scrollBarScrollPositionIntervalReachedEventCallbackDelegate = (OnScrollBarScrollPositionIntervalReached);
299 ScrollPositionIntervalReachedSignal().Connect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
301 _scrollBarScrollPositionIntervalReachedEventHandler += value;
305 _scrollBarScrollPositionIntervalReachedEventHandler -= value;
306 if (_scrollBarScrollPositionIntervalReachedEventHandler == null && ScrollPositionIntervalReachedSignal().Empty() == false)
308 ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
314 /// The direction of the scrollbar.
316 /// <since_tizen> 3 </since_tizen>
317 public enum Direction
320 /// Scroll in the vertical direction
322 /// <since_tizen> 3 </since_tizen>
325 /// Scroll in the horizontal direction
327 /// <since_tizen> 3 </since_tizen>
332 /// The indicator height policy.
334 /// <since_tizen> 3 </since_tizen>
335 public enum IndicatorHeightPolicyType
338 /// Variable height changed dynamically according to the length of scroll content
340 /// <since_tizen> 3 </since_tizen>
343 /// Fixed height regardless of the length of scroll content
345 /// <since_tizen> 3 </since_tizen>
350 /// The direction of the scrollbar.
352 /// <since_tizen> 3 </since_tizen>
353 public Direction ScrollDirection
358 return (Direction)GetValue(ScrollDirectionProperty);
362 SetValue(ScrollDirectionProperty, value);
367 /// The indicator height policy.
369 /// <since_tizen> 3 </since_tizen>
370 public IndicatorHeightPolicyType IndicatorHeightPolicy
374 return (IndicatorHeightPolicyType)GetValue(IndicatorHeightPolicyProperty);
378 SetValue(IndicatorHeightPolicyProperty, value);
383 /// The fixed height of the scroll indicator.
385 /// <since_tizen> 3 </since_tizen>
386 public float IndicatorFixedHeight
390 return (float)GetValue(IndicatorFixedHeightProperty);
394 SetValue(IndicatorFixedHeightProperty, value);
399 /// The duration in seconds for the scroll indicator to become fully visible.
401 /// <since_tizen> 3 </since_tizen>
402 public float IndicatorShowDuration
406 return (float)GetValue(IndicatorShowDurationProperty);
410 SetValue(IndicatorShowDurationProperty, value);
415 /// The duration in seconds for the scroll indicator to become fully invisible.
417 /// <since_tizen> 3 </since_tizen>
418 public float IndicatorHideDuration
422 return (float)GetValue(IndicatorHideDurationProperty);
426 SetValue(IndicatorHideDurationProperty, value);
431 /// The list of values to get the notification when the current scroll position of the scrollable object goes above or below any of these values.
433 /// <since_tizen> 3 </since_tizen>
434 public Tizen.NUI.PropertyArray ScrollPositionIntervals
438 return (PropertyArray)GetValue(ScrollPositionIntervalsProperty);
442 SetValue(ScrollPositionIntervalsProperty, value);
447 /// The minimum height for a variable size indicator.
449 /// <since_tizen> 3 </since_tizen>
450 public float IndicatorMinimumHeight
454 return (float)GetValue(IndicatorMinimumHeightProperty);
458 SetValue(IndicatorMinimumHeightProperty, value);
463 /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical.
465 /// <since_tizen> 3 </since_tizen>
466 public float IndicatorStartPadding
470 return (float)GetValue(IndicatorStartPaddingProperty);
474 SetValue(IndicatorStartPaddingProperty, value);
479 /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical.
481 /// <since_tizen> 3 </since_tizen>
482 public float IndicatorEndPadding
486 return (float)GetValue(IndicatorEndPaddingProperty);
490 SetValue(IndicatorEndPaddingProperty, value);
495 /// Sets the source of the scroll position properties.
497 /// <param name="handle">The handle of the object owing the scroll properties.</param>
498 /// <param name="propertyScrollPosition">The index of the scroll position property(The scroll position, type float).</param>
499 /// <param name="propertyMinScrollPosition">The index of the minimum scroll position property(The minimum scroll position, type float).</param>
500 /// <param name="propertyMaxScrollPosition">The index of the maximum scroll position property(The maximum scroll position, type float).</param>
501 /// <param name="propertyScrollContentSize">The index of the scroll content size property(The size of the scrollable content in actor coordinates, type float).</param>
502 /// <remarks>The handle to the object owing the scroll properties has been initialised and the property index must be valid.</remarks>
503 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
504 [EditorBrowsable(EditorBrowsableState.Never)]
505 public void SetScrollPropertySource(Animatable handle, int propertyScrollPosition, int propertyMinScrollPosition, int propertyMaxScrollPosition, int propertyScrollContentSize)
507 Interop.ScrollBar.ScrollBar_SetScrollPropertySource(swigCPtr, Animatable.getCPtr(handle), propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
511 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj)
513 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
516 internal void SetScrollIndicator(View indicator)
518 Interop.ScrollBar.ScrollBar_SetScrollIndicator(swigCPtr, View.getCPtr(indicator));
519 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
522 internal View GetScrollIndicator()
524 View ret = new View(Interop.ScrollBar.ScrollBar_GetScrollIndicator(swigCPtr), true);
525 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529 internal void SetScrollDirection(ScrollBar.Direction direction)
531 Interop.ScrollBar.ScrollBar_SetScrollDirection(swigCPtr, (int)direction);
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
535 internal ScrollBar.Direction GetScrollDirection()
537 ScrollBar.Direction ret = (ScrollBar.Direction)Interop.ScrollBar.ScrollBar_GetScrollDirection(swigCPtr);
538 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542 internal void SetIndicatorHeightPolicy(ScrollBar.IndicatorHeightPolicyType policy)
544 Interop.ScrollBar.ScrollBar_SetIndicatorHeightPolicy(swigCPtr, (int)policy);
545 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
548 internal ScrollBar.IndicatorHeightPolicyType GetIndicatorHeightPolicy()
550 ScrollBar.IndicatorHeightPolicyType ret = (ScrollBar.IndicatorHeightPolicyType)Interop.ScrollBar.ScrollBar_GetIndicatorHeightPolicy(swigCPtr);
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
555 internal void SetIndicatorFixedHeight(float height)
557 Interop.ScrollBar.ScrollBar_SetIndicatorFixedHeight(swigCPtr, height);
558 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561 internal float GetIndicatorFixedHeight()
563 float ret = Interop.ScrollBar.ScrollBar_GetIndicatorFixedHeight(swigCPtr);
564 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
568 internal void SetIndicatorShowDuration(float durationSeconds)
570 Interop.ScrollBar.ScrollBar_SetIndicatorShowDuration(swigCPtr, durationSeconds);
571 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574 internal float GetIndicatorShowDuration()
576 float ret = Interop.ScrollBar.ScrollBar_GetIndicatorShowDuration(swigCPtr);
577 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
581 internal void SetIndicatorHideDuration(float durationSeconds)
583 Interop.ScrollBar.ScrollBar_SetIndicatorHideDuration(swigCPtr, durationSeconds);
584 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
587 internal float GetIndicatorHideDuration()
589 float ret = Interop.ScrollBar.ScrollBar_GetIndicatorHideDuration(swigCPtr);
590 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
594 internal void ShowIndicator()
596 Interop.ScrollBar.ScrollBar_ShowIndicator(swigCPtr);
597 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600 internal void HideIndicator()
602 Interop.ScrollBar.ScrollBar_HideIndicator(swigCPtr);
603 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606 internal VoidSignal PanFinishedSignal()
608 VoidSignal ret = new VoidSignal(Interop.ScrollBar.ScrollBar_PanFinishedSignal(swigCPtr), false);
609 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613 internal FloatSignal ScrollPositionIntervalReachedSignal()
615 FloatSignal ret = new FloatSignal(Interop.ScrollBar.ScrollBar_ScrollPositionIntervalReachedSignal(swigCPtr), false);
616 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621 /// To dispose the ScrollBar instance.
623 /// <since_tizen> 3 </since_tizen>
624 protected override void Dispose(DisposeTypes type)
631 //Release your own unmanaged resources here.
632 //You should not access any managed member here except static instance.
633 //because the execution order of Finalizes is non-deterministic.
636 if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null)
638 ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate);
641 if (_scrollBarPanFinishedEventCallbackDelegate != null)
643 PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate);
647 if (swigCPtr.Handle != global::System.IntPtr.Zero)
652 Interop.ScrollBar.delete_ScrollBar(swigCPtr);
654 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
660 // Callback for ScrollBar PanFinishedSignal
661 private void OnScrollBarPanFinished()
663 PanFinishedEventArgs e = new PanFinishedEventArgs();
665 if (_scrollBarPanFinishedEventHandler != null)
667 //here we send all data to user event handlers
668 _scrollBarPanFinishedEventHandler(this, e);
673 // Callback for ScrollBar ScrollPositionIntervalReachedSignal
674 private void OnScrollBarScrollPositionIntervalReached(float position)
676 ScrollIntervalEventArgs e = new ScrollIntervalEventArgs();
677 e.CurrentScrollPosition = position;
679 if (_scrollBarScrollPositionIntervalReachedEventHandler != null)
681 //here we send all data to user event handlers
682 _scrollBarScrollPositionIntervalReachedEventHandler(this, e);
689 /// Event arguments that passed via the PanFinished event.
691 /// <since_tizen> 3 </since_tizen>
692 public class PanFinishedEventArgs : EventArgs
697 /// Event arguments that passed via the ScrollPositionIntervalReached event.
699 /// <since_tizen> 3 </since_tizen>
700 public class ScrollIntervalEventArgs : EventArgs
702 private float _currentScrollPosition;
705 /// The current scroll position of the scrollable content.
707 /// <since_tizen> 3 </since_tizen>
708 public float CurrentScrollPosition
712 return _currentScrollPosition;
716 _currentScrollPosition = value;
721 internal new class Property
723 internal static readonly int SCROLL_DIRECTION = Interop.ScrollBar.ScrollBar_Property_SCROLL_DIRECTION_get();
724 internal static readonly int INDICATOR_HEIGHT_POLICY = Interop.ScrollBar.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get();
725 internal static readonly int INDICATOR_FIXED_HEIGHT = Interop.ScrollBar.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get();
726 internal static readonly int INDICATOR_SHOW_DURATION = Interop.ScrollBar.ScrollBar_Property_INDICATOR_SHOW_DURATION_get();
727 internal static readonly int INDICATOR_HIDE_DURATION = Interop.ScrollBar.ScrollBar_Property_INDICATOR_HIDE_DURATION_get();
728 internal static readonly int SCROLL_POSITION_INTERVALS = Interop.ScrollBar.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get();
729 internal static readonly int INDICATOR_MINIMUM_HEIGHT = Interop.ScrollBar.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get();
730 internal static readonly int INDICATOR_START_PADDING = Interop.ScrollBar.ScrollBar_Property_INDICATOR_START_PADDING_get();
731 internal static readonly int INDICATOR_END_PADDING = Interop.ScrollBar.ScrollBar_Property_INDICATOR_END_PADDING_get();