7ac6ed94e1f323e116fdd298cb779c2da9b5eb23
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / Slider.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17 using System;
18 using Tizen.NUI.BaseComponents;
19 using System.ComponentModel;
20 using Tizen.NUI.Binding;
21
22 namespace Tizen.NUI.Components
23 {
24     /// <summary>
25     /// Slider value changed event data.
26     /// </summary>
27     /// <since_tizen> 8 </since_tizen>
28     public class SliderValueChangedEventArgs : EventArgs
29     {
30         /// <summary>
31         /// Current Slider value
32         /// </summary>
33         /// <since_tizen> 8 </since_tizen>
34         public float CurrentValue { get; set; }
35     }
36
37     /// <summary>
38     /// Slider sliding started event data.
39     /// </summary>
40     /// <since_tizen> 8 </since_tizen>
41     public class SliderSlidingStartedEventArgs : EventArgs
42     {
43         /// <summary>
44         /// Current Slider value
45         /// </summary>
46         /// <since_tizen> 8 </since_tizen>
47         public float CurrentValue { get; set; }
48     }
49
50     /// <summary>
51     /// Slider sliding finished event data.
52     /// </summary>
53     /// <since_tizen> 8 </since_tizen>
54     public class SliderSlidingFinishedEventArgs : EventArgs
55     {
56         /// <summary>
57         /// Current Slider value
58         /// </summary>
59         /// <since_tizen> 8 </since_tizen>
60         public float CurrentValue { get; set; }
61     }
62
63     /// <summary>
64     /// A slider lets users select a value from a continuous or discrete range of values by moving the slider thumb.
65     /// </summary>
66     /// <since_tizen> 6 </since_tizen>
67     public partial class Slider : Control
68     {
69         /// <summary>
70         /// IndicatorTypeProperty
71         /// </summary>
72         [EditorBrowsable(EditorBrowsableState.Never)]
73         public static readonly BindableProperty IndicatorTypeProperty = BindableProperty.Create("IndicatorType", typeof(IndicatorType), typeof(Slider), IndicatorType.None, propertyChanged: (bindable, oldValue, newValue) =>
74         {
75             var instance = (Slider)bindable;
76             if (newValue != null)
77             {
78                 instance.privateIndicatorType = (IndicatorType)newValue;
79             }
80         },
81         defaultValueCreator: (bindable) =>
82         {
83             var instance = (Slider)bindable;
84             return instance.privateIndicatorType;
85         });
86
87         /// <summary>
88         /// SpaceBetweenTrackAndIndicatorProperty
89         /// </summary>
90         [EditorBrowsable(EditorBrowsableState.Never)]
91         public static readonly BindableProperty SpaceBetweenTrackAndIndicatorProperty = BindableProperty.Create(nameof(SpaceBetweenTrackAndIndicator), typeof(uint), typeof(Slider), (uint)0, propertyChanged: (bindable, oldValue, newValue) =>
92         {
93             var instance = (Slider)bindable;
94             if (newValue != null)
95             {
96                 instance.privateSpaceBetweenTrackAndIndicator = (uint)newValue;
97             }
98         },
99         defaultValueCreator: (bindable) =>
100         {
101             var instance = (Slider)bindable;
102             return instance.privateSpaceBetweenTrackAndIndicator;
103         });
104
105         /// <summary>
106         /// TrackThicknessProperty
107         /// </summary>
108         [EditorBrowsable(EditorBrowsableState.Never)]
109         public static readonly BindableProperty TrackThicknessProperty = BindableProperty.Create(nameof(TrackThickness), typeof(uint), typeof(Slider), (uint)0, propertyChanged: (bindable, oldValue, newValue) =>
110         {
111             var instance = (Slider)bindable;
112             if (newValue != null)
113             {
114                 instance.privateTrackThickness = (uint)newValue;
115             }
116         },
117         defaultValueCreator: (bindable) =>
118         {
119             var instance = (Slider)bindable;
120             return instance.privateTrackThickness;
121         });
122
123         /// <summary>
124         /// IsValueShownProperty
125         /// </summary>
126         [EditorBrowsable(EditorBrowsableState.Never)]
127         public static readonly BindableProperty IsValueShownProperty = BindableProperty.Create(nameof(IsValueShown), typeof(bool), typeof(Slider), true, propertyChanged: (bindable, oldValue, newValue) =>
128         {
129             var instance = (Slider)bindable;
130             if (newValue != null)
131             {
132                 bool newValueShown = (bool)newValue;
133                 if (instance.isValueShown != newValueShown)
134                 {
135                     instance.isValueShown = newValueShown;
136                 }
137             }
138         },
139         defaultValueCreator: (bindable) =>
140         {
141             var instance = (Slider)bindable;
142             return instance.isValueShown;
143         });
144
145         /// <summary>
146         /// ValueIndicatorTextProperty
147         /// </summary>
148         [EditorBrowsable(EditorBrowsableState.Never)]
149         public static readonly BindableProperty ValueIndicatorTextProperty = BindableProperty.Create(nameof(ValueIndicatorText), typeof(string), typeof(Slider), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
150         {
151             var instance = (Slider)bindable;
152             if (newValue != null)
153             {
154                 string newText = (string)newValue;
155                 instance.valueIndicatorText.Text = newText;
156             }
157         },
158         defaultValueCreator: (bindable) =>
159         {
160             var instance = (Slider)bindable;
161             return instance.valueIndicatorText.Text;
162         });
163
164         /// <summary>
165         /// Bindable property of CurrentValue
166         /// <remark>
167         /// Hidden API, used for NUI XAML data binding
168         /// </remark>
169         /// </summary>
170         [EditorBrowsable(EditorBrowsableState.Never)]
171         public static readonly BindableProperty CurrentValueProperty = BindableProperty.Create(nameof(CurrentValue), typeof(float), typeof(Slider), 0.0f, BindingMode.TwoWay,
172             propertyChanged: (bindable, oldValue, newValue) =>
173             {
174                 var instance = (Slider)bindable;
175
176                 if (newValue != null)
177                 {
178                     instance.curValue = (float)newValue;
179                     if (Accessibility.Accessibility.Enabled && instance.IsHighlighted)
180                     {
181                         instance.EmitAccessibilityEvent(AccessibilityPropertyChangeEvent.Value);
182                     }
183                     instance.UpdateValue();
184                 }
185             },
186             defaultValueCreator: (bindable) =>
187             {
188                 var instance = (Slider)bindable;
189                 return instance.curValue;
190             }
191         );
192
193         /// <summary>
194         /// IsEnabledProperty
195         /// </summary>
196         [EditorBrowsable(EditorBrowsableState.Never)]
197         public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(Slider), true, propertyChanged: (bindable, oldValue, newValue) =>
198         {
199             var instance = (Slider)bindable;
200             if (newValue != null)
201             {
202                 bool newEnabled = (bool)newValue;
203                 if (instance.isEnabled != newEnabled)
204                 {
205                     instance.isEnabled = newEnabled;
206                     instance.Sensitive = newEnabled;
207                     instance.UpdateValue();
208                 }
209             }
210         },
211         defaultValueCreator: (bindable) => ((Slider)bindable).isEnabled);
212
213         static Slider() { }
214
215         /// <summary>
216         /// The constructor of the Slider class.
217         /// </summary>
218         /// <since_tizen> 6 </since_tizen>
219         public Slider()
220         {
221             Initialize();
222         }
223
224         /// <summary>
225         /// The constructor of the Slider class with specific style.
226         /// </summary>
227         /// <param name="style">The string to initialize the Slider</param>
228         /// <since_tizen> 8 </since_tizen>
229         public Slider(string style) : base(style)
230         {
231             Initialize();
232         }
233
234         /// <summary>
235         /// The constructor of the Slider class with specific style.
236         /// </summary>
237         /// <param name="sliderStyle">The style object to initialize the Slider</param>
238         /// <since_tizen> 8 </since_tizen>
239         public Slider(SliderStyle sliderStyle) : base(sliderStyle)
240         {
241             Initialize();
242         }
243
244         /// <summary>
245         /// The value changed event handler.
246         /// </summary>
247         /// <since_tizen> 6 </since_tizen>
248         [Obsolete("Deprecated in API8; Will be removed in API10. Please use ValueChanged event instead.")]
249         public event EventHandler<ValueChangedArgs> ValueChangedEvent
250         {
251             add
252             {
253                 valueChangedHandler += value;
254             }
255             remove
256             {
257                 valueChangedHandler -= value;
258             }
259         }
260
261         /// <summary>
262         /// The sliding finished event handler.
263         /// </summary>
264         /// <since_tizen> 6 </since_tizen>
265         [Obsolete("Deprecated in API8; Will be removed in API10. Please use SlidingFinished event instead.")]
266         public event EventHandler<SlidingFinishedArgs> SlidingFinishedEvent
267         {
268             add
269             {
270                 slidingFinishedHandler += value;
271             }
272             remove
273             {
274                 slidingFinishedHandler -= value;
275             }
276         }
277
278         /// <summary>
279         /// The value changed event handler.
280         /// </summary>
281         /// <since_tizen> 8 </since_tizen>
282         public event EventHandler<SliderValueChangedEventArgs> ValueChanged
283         {
284             add
285             {
286                 sliderValueChangedHandler += value;
287             }
288             remove
289             {
290                 sliderValueChangedHandler -= value;
291             }
292         }
293
294         /// <summary>
295         /// The sliding started event handler.
296         /// </summary>
297         /// <since_tizen> 8 </since_tizen>
298         public event EventHandler<SliderSlidingStartedEventArgs> SlidingStarted
299         {
300             add
301             {
302                 sliderSlidingStartedHandler += value;
303             }
304             remove
305             {
306                 sliderSlidingStartedHandler -= value;
307             }
308         }
309
310         /// <summary>
311         /// The sliding finished event handler.
312         /// </summary>
313         /// <since_tizen> 8 </since_tizen>
314         public event EventHandler<SliderSlidingFinishedEventArgs> SlidingFinished
315         {
316             add
317             {
318                 sliderSlidingFinishedHandler += value;
319             }
320             remove
321             {
322                 sliderSlidingFinishedHandler -= value;
323             }
324         }
325
326         /// <summary>
327         /// The state changed event handler.
328         /// </summary>
329         /// <since_tizen> 6 </since_tizen>
330         [Obsolete("Deprecated in API8; Will be removed in API10. Please use View.ControlStateChangedEvent")]
331         public event EventHandler<StateChangedArgs> StateChangedEvent
332         {
333             add
334             {
335                 stateChangedHandler += value;
336             }
337             remove
338             {
339                 stateChangedHandler -= value;
340             }
341         }
342
343         /// <summary>
344         /// The direction type of slider.
345         /// </summary>
346         /// <since_tizen> 6 </since_tizen>
347         public enum DirectionType
348         {
349             /// <summary>
350             /// The Horizontal type.
351             /// </summary>
352             /// <since_tizen> 6 </since_tizen>
353             Horizontal,
354
355             /// <summary>
356             /// The Vertical type.
357             /// </summary>
358             /// <since_tizen> 6 </since_tizen>
359             Vertical
360         }
361
362         /// <summary>
363         /// The indicator type of slider.
364         /// </summary>
365         /// <since_tizen> 6 </since_tizen>
366         public enum IndicatorType
367         {
368             /// <summary> Only contains slider bar.</summary>
369             /// <since_tizen> 6 </since_tizen>
370             None,
371
372             /// <summary> Contains slider bar, IndicatorImage.</summary>
373             /// <since_tizen> 6 </since_tizen>
374             Image,
375
376             /// <summary> Contains slider bar, IndicatorText.</summary>
377             /// <since_tizen> 6 </since_tizen>
378             Text
379         }
380
381         /// <summary>
382         /// Return currently applied style.
383         /// </summary>
384         /// <remarks>
385         /// Modifying contents in style may cause unexpected behaviour.
386         /// </remarks>
387         /// <since_tizen> 8 </since_tizen>
388         public SliderStyle Style => (SliderStyle)(ViewStyle as SliderStyle)?.Clone();
389
390         /// <summary>
391         /// Gets or sets the direction type of slider.
392         /// </summary>
393         /// <since_tizen> 6 </since_tizen>
394         public DirectionType Direction
395         {
396             get
397             {
398                 return direction;
399             }
400             set
401             {
402                 if (direction == value)
403                 {
404                     return;
405                 }
406                 direction = value;
407                 RelayoutBaseComponent(false);
408                 UpdateBgTrackSize();
409                 UpdateBgTrackPosition();
410                 UpdateWarningTrackSize();
411                 UpdateValue();
412             }
413         }
414
415         /// <summary>
416         /// Gets or sets the indicator type, arrow or sign.
417         /// </summary>
418         /// <since_tizen> 6 </since_tizen>
419         public IndicatorType Indicator
420         {
421             get
422             {
423                 return (IndicatorType)GetValue(IndicatorTypeProperty);
424             }
425             set
426             {
427                 SetValue(IndicatorTypeProperty, value);
428             }
429         }
430
431         /// <summary>
432         /// Gets or sets the minimum value of slider.
433         /// </summary>
434         /// <since_tizen> 6 </since_tizen>
435         public float MinValue
436         {
437             get
438             {
439                 return minValue;
440             }
441             set
442             {
443                 minValue = value;
444                 UpdateValue();
445             }
446         }
447
448         /// <summary>
449         /// Gets or sets the maximum value of slider.
450         /// </summary>
451         /// <since_tizen> 6 </since_tizen>
452         public float MaxValue
453         {
454             get
455             {
456                 return maxValue;
457             }
458             set
459             {
460                 maxValue = value;
461                 UpdateValue();
462             }
463         }
464
465         /// <summary>
466         /// Gets or sets the current value of slider.
467         /// </summary>
468         /// <since_tizen> 6 </since_tizen>
469         public float CurrentValue
470         {
471             get
472             {
473                 return (float)GetValue(CurrentValueProperty);
474             }
475             set
476             {
477                 SetValue(CurrentValueProperty, value);
478             }
479         }
480
481         /// <summary>
482         /// Gets or sets the size of the thumb image object.
483         /// </summary>
484         /// <since_tizen> 6 </since_tizen>
485         public Size ThumbSize
486         {
487             get
488             {
489                 return thumbImage?.Size;
490             }
491             set
492             {
493                 if (null != thumbImage)
494                 {
495                     thumbImage.Size = value;
496                     thumbSize = value;
497                 }
498             }
499         }
500
501         /// <summary>
502         /// Gets or sets the resource url of the thumb image object.
503         ///
504         /// Please use ThumbImageUrl property.
505         /// </summary>
506         /// <since_tizen> 6 </since_tizen>
507         public string ThumbImageURL
508         {
509             get
510             {
511                 return thumbImage?.ResourceUrl;
512             }
513             set
514             {
515                 if (null != thumbImage)
516                 {
517                     thumbImage.ResourceUrl = value;
518                     thumbImageUrl = value;
519                 }
520             }
521         }
522
523         /// <summary>
524         /// Gets or sets the resource url selector of the thumb image object.
525         /// Getter returns copied selector value if exist, null otherwise.
526         ///
527         /// Please use ThumbImageUrl property.
528         /// </summary>
529         /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
530         /// <since_tizen> 6 </since_tizen>
531         public StringSelector ThumbImageURLSelector
532         {
533             get => thumbImage == null ? null : new StringSelector(thumbImage.ResourceUrlSelector);
534             set
535             {
536                 if (value == null || thumbImage == null)
537                 {
538                     throw new NullReferenceException("Slider.ThumbImageURLSelector is null");
539                 }
540                 else
541                 {
542                     thumbImage.ResourceUrlSelector = value;
543                 }
544             }
545         }
546
547         /// <summary>
548         /// Gets or sets the Url of the thumb image.
549         /// </summary>
550         /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
551         /// <since_tizen> 9 </since_tizen>
552         public Selector<string> ThumbImageUrl
553         {
554             get
555             {
556                 if (thumbImage == null)
557                 {
558                     return null;
559                 }
560                 else
561                 {
562                     return thumbImage.ResourceUrlSelector;
563                 }
564             }
565             set
566             {
567                 if (value == null || thumbImage == null)
568                 {
569                     throw new NullReferenceException("Slider.ThumbImageUrl is null");
570                 }
571                 else
572                 {
573                     thumbImage.ResourceUrlSelector = value;
574                 }
575             }
576         }
577
578         /// <summary>
579         /// Gets or sets the color of the thumb image object.
580         /// </summary>
581         /// <since_tizen> 8 </since_tizen>
582         public Color ThumbColor
583         {
584             get
585             {
586                 return thumbImage?.Color;
587             }
588             set
589             {
590                 if (null != thumbImage)
591                 {
592                     thumbImage.BackgroundColor = value;
593                     thumbColor = value;
594                 }
595             }
596         }
597
598         /// <summary>
599         /// Gets or sets the color of the background track image object.
600         /// </summary>
601         /// <since_tizen> 6 </since_tizen>
602         public Color BgTrackColor
603         {
604             get
605             {
606                 return bgTrackImage?.BackgroundColor;
607             }
608             set
609             {
610                 if (null != bgTrackImage)
611                 {
612                     bgTrackImage.BackgroundColor = value;
613                 }
614             }
615         }
616
617         /// <summary>
618         /// Gets or sets the color of the slided track image object.
619         /// </summary>
620         /// <since_tizen> 6 </since_tizen>
621         public Color SlidedTrackColor
622         {
623             get
624             {
625                 return slidedTrackImage?.BackgroundColor;
626             }
627             set
628             {
629                 if (null != slidedTrackImage)
630                 {
631                     slidedTrackImage.BackgroundColor = value;
632                 }
633             }
634         }
635
636         /// <summary>
637         /// Gets or sets the thickness value of the track.
638         /// </summary>
639         /// <since_tizen> 6 </since_tizen>
640         public uint TrackThickness
641         {
642             get
643             {
644                 return (uint)GetValue(TrackThicknessProperty);
645             }
646             set
647             {
648                 SetValue(TrackThicknessProperty, value);
649             }
650         }
651
652         /// <summary>
653         /// Gets or sets the warning start value between minimum value and maximum value of slider.
654         /// </summary>
655         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
656         [EditorBrowsable(EditorBrowsableState.Never)]
657         public float WarningStartValue
658         {
659             get
660             {
661                 return warningStartValue;
662             }
663             set
664             {
665                 warningStartValue = value;
666                 UpdateValue();
667             }
668         }
669
670         /// <summary>
671         /// Gets or sets the color of the warning track image object.
672         /// </summary>
673         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
674         [EditorBrowsable(EditorBrowsableState.Never)]
675         public Color WarningTrackColor
676         {
677             get
678             {
679                 return warningTrackImage?.BackgroundColor;
680             }
681             set
682             {
683                 if (null != warningTrackImage)
684                 {
685                     warningTrackImage.BackgroundColor = value;
686                 }
687             }
688         }
689
690         /// <summary>
691         /// Gets or sets the color of the warning slided track image object.
692         /// </summary>
693         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
694         [EditorBrowsable(EditorBrowsableState.Never)]
695         public Color WarningSlidedTrackColor
696         {
697             get
698             {
699                 return warningSlidedTrackImage?.BackgroundColor;
700             }
701             set
702             {
703                 if (null != warningSlidedTrackImage)
704                 {
705                     warningSlidedTrackImage.BackgroundColor = value;
706                 }
707             }
708         }
709
710         /// <summary>
711         /// Gets or sets the Url of the warning thumb image.
712         /// </summary>
713         /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
714         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
715         [EditorBrowsable(EditorBrowsableState.Never)]
716         public Selector<string> WarningThumbImageUrl
717         {
718             get
719             {
720                 return warningThumbImageUrlSelector;
721             }
722             set
723             {
724                 if (value == null || thumbImage == null)
725                 {
726                     throw new NullReferenceException("Slider.WarningThumbImageUrl is null");
727                 }
728                 else
729                 {
730                     warningThumbImageUrlSelector = value;
731                 }
732             }
733         }
734
735         /// <summary>
736         /// Gets or sets the color of the warning thumb image object.
737         /// </summary>
738         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
739         [EditorBrowsable(EditorBrowsableState.Never)]
740         public Color WarningThumbColor
741         {
742             get
743             {
744                 return warningThumbColor;
745             }
746             set
747             {
748                 warningThumbColor = value;
749             }
750         }
751
752         /// <summary>
753         /// Gets or sets the resource url of the low indicator image object.
754         /// </summary>
755         /// <since_tizen> 6 </since_tizen>
756         public string LowIndicatorImageURL
757         {
758             get
759             {
760                 return lowIndicatorImage?.ResourceUrl;
761             }
762             set
763             {
764                 if (null == lowIndicatorImage) lowIndicatorImage = new ImageView();
765                 lowIndicatorImage.ResourceUrl = value;
766             }
767         }
768
769         /// <summary>
770         /// Gets or sets the resource url of the high indicator image object.
771         /// </summary>
772         /// <since_tizen> 6 </since_tizen>
773         public string HighIndicatorImageURL
774         {
775             get
776             {
777                 return highIndicatorImage?.ResourceUrl;
778             }
779             set
780             {
781                 if (null == highIndicatorImage) highIndicatorImage = new ImageView();
782                 highIndicatorImage.ResourceUrl = value;
783             }
784         }
785
786         /// <summary>
787         /// Gets or sets the text content of the low indicator text object.
788         /// </summary>
789         /// <since_tizen> 6 </since_tizen>
790         public string LowIndicatorTextContent
791         {
792             get
793             {
794                 return lowIndicatorText?.Text;
795             }
796             set
797             {
798                 if (null != lowIndicatorText)
799                 {
800                     lowIndicatorText.Text = value;
801                 }
802             }
803         }
804
805         /// <summary>
806         /// Gets or sets the text content of the high indicator text object.
807         /// </summary>
808         /// <since_tizen> 6 </since_tizen>
809         public string HighIndicatorTextContent
810         {
811             get
812             {
813                 return highIndicatorText?.Text;
814             }
815             set
816             {
817                 if (null != highIndicatorText)
818                 {
819                     highIndicatorText.Text = value;
820                 }
821             }
822         }
823
824         /// <summary>
825         /// Gets or sets the size of the low indicator object(image or text).
826         /// </summary>
827         /// <since_tizen> 6 </since_tizen>
828         public Size LowIndicatorSize
829         {
830             get
831             {
832                 return lowIndicatorSize;
833             }
834             set
835             {
836                 lowIndicatorSize = value;
837                 UpdateLowIndicatorSize();
838                 UpdateBgTrackSize();
839                 UpdateBgTrackPosition();
840                 UpdateValue();
841             }
842         }
843
844         /// <summary>
845         /// Gets or sets the size of the high indicator object(image or text).
846         /// </summary>
847         /// <since_tizen> 6 </since_tizen>
848         public Size HighIndicatorSize
849         {
850             get
851             {
852                 return highIndicatorText?.Size;
853             }
854             set
855             {
856                 if (null != highIndicatorText)
857                 {
858                     highIndicatorText.Size = value;
859                 }
860             }
861         }
862
863         /// <summary>
864         /// Gets or sets the value of the space between track and indicator.
865         /// </summary>
866         /// <since_tizen> 6 </since_tizen>
867         public uint SpaceBetweenTrackAndIndicator
868         {
869             get
870             {
871                 return (uint)GetValue(SpaceBetweenTrackAndIndicatorProperty);
872             }
873             set
874             {
875                 SetValue(SpaceBetweenTrackAndIndicatorProperty, value);
876             }
877         }
878
879         /// <summary>
880         /// Flag to decide whether the value indicator is shown
881         /// </summary>
882         /// <since_tizen> 9 </since_tizen>
883         public bool IsValueShown
884         {
885             get
886             {
887                 return (bool)GetValue(IsValueShownProperty);
888             }
889             set
890             {
891                 SetValue(IsValueShownProperty, value);
892             }
893         }
894
895         /// <summary>
896         /// Gets or sets the text of value indicator.
897         /// </summary>
898         /// <since_tizen> 9 </since_tizen>
899         public string ValueIndicatorText
900         {
901             get
902             {
903                 return (string)GetValue(ValueIndicatorTextProperty);
904             }
905             set
906             {
907                 SetValue(ValueIndicatorTextProperty, value);
908             }
909         }
910
911         /// <summary>
912         /// Gets or sets the size of the value indicator image object.
913         /// </summary>
914         /// <since_tizen> 9 </since_tizen>
915         public Size ValueIndicatorSize
916         {
917             get
918             {
919                 return valueIndicatorImage?.Size;
920             }
921             set
922             {
923                 if (null != valueIndicatorImage)
924                 {
925                     valueIndicatorImage.Size = value;
926                 }
927             }
928         }
929
930         /// <summary>
931         /// Gets or sets the resource url of the value indicator image object.
932         /// </summary>
933         /// <since_tizen> 9 </since_tizen>
934         public string ValueIndicatorUrl
935         {
936             get
937             {
938                 return valueIndicatorImage?.ResourceUrl;
939             }
940             set
941             {
942                 if (null != valueIndicatorImage)
943                 {
944                     valueIndicatorImage.ResourceUrl = value;
945                 }
946             }
947         }
948
949         /// <summary>
950         /// Flag to decide whether the thumb snaps to the nearest discrete value when the user drags the thumb or taps.
951         ///
952         /// The default value is false.
953         /// </summary>
954         /// <since_tizen> 9 </since_tizen>
955         public bool IsDiscrete { get; set; } = false;
956
957         /// <summary>
958         /// Gets or sets the discrete value of slider.
959         /// </summary>
960         /// <remarks>
961         /// The discrete value is evenly spaced between MinValue and MaxValue.
962         /// For example, MinValue is 0, MaxValue is 100, and DiscreteValue is 20.
963         /// Then, the thumb can only go to 0, 20, 40, 60, 80, and 100.
964         /// The default is 0.
965         /// </remarks>
966         /// <since_tizen> 9 </since_tizen>
967         public float DiscreteValue
968         {
969             get
970             {
971                 return discreteValue;
972             }
973             set
974             {
975                 discreteValue = value;
976                 UpdateValue();
977             }
978         }
979
980         /// <summary>
981         /// Flag to decide enable or disable in Slider.
982         /// </summary>
983         [EditorBrowsable(EditorBrowsableState.Never)]
984         public bool IsEnabled
985         {
986             get
987             {
988                 return (bool)GetValue(IsEnabledProperty);
989             }
990             set
991             {
992                 SetValue(IsEnabledProperty, value);
993             }
994         }
995
996         private Extents spaceBetweenTrackAndIndicator
997         {
998             get
999             {
1000                 if (null == spaceTrackIndicator)
1001                 {
1002                     spaceTrackIndicator = new Extents((ushort start, ushort end, ushort top, ushort bottom) =>
1003                     {
1004                         Extents extents = new Extents(start, end, top, bottom);
1005                         spaceTrackIndicator.CopyFrom(extents);
1006                     }, 0, 0, 0, 0);
1007                 }
1008
1009                 return spaceTrackIndicator;
1010             }
1011         }
1012
1013         private IndicatorType privateIndicatorType
1014         {
1015             get
1016             {
1017                 return indicatorType;
1018             }
1019             set
1020             {
1021                 if (indicatorType == value)
1022                 {
1023                     return;
1024                 }
1025                 indicatorType = value;
1026                 RelayoutBaseComponent(false);
1027                 UpdateBgTrackSize();
1028                 UpdateBgTrackPosition();
1029                 UpdateValue();
1030             }
1031         }
1032
1033         private uint privateTrackThickness
1034         {
1035             get
1036             {
1037                 return trackThickness ?? 0;
1038             }
1039             set
1040             {
1041                 trackThickness = value;
1042                 if (bgTrackImage != null)
1043                 {
1044                     if (direction == DirectionType.Horizontal)
1045                     {
1046                         bgTrackImage.SizeHeight = (float)trackThickness.Value;
1047                     }
1048                     else if (direction == DirectionType.Vertical)
1049                     {
1050                         bgTrackImage.SizeWidth = (float)trackThickness.Value;
1051                     }
1052                 }
1053                 if (slidedTrackImage != null)
1054                 {
1055                     if (direction == DirectionType.Horizontal)
1056                     {
1057                         slidedTrackImage.SizeHeight = (float)trackThickness.Value;
1058                     }
1059                     else if (direction == DirectionType.Vertical)
1060                     {
1061                         slidedTrackImage.SizeWidth = (float)trackThickness.Value;
1062                     }
1063                 }
1064                 if (warningTrackImage != null)
1065                 {
1066                     if (direction == DirectionType.Horizontal)
1067                     {
1068                         warningTrackImage.SizeHeight = (float)trackThickness.Value;
1069                     }
1070                     else if (direction == DirectionType.Vertical)
1071                     {
1072                         warningTrackImage.SizeWidth = (float)trackThickness.Value;
1073                     }
1074                 }
1075                 if (warningSlidedTrackImage != null)
1076                 {
1077                     if (direction == DirectionType.Horizontal)
1078                     {
1079                         warningSlidedTrackImage.SizeHeight = (float)trackThickness.Value;
1080                     }
1081                     else if (direction == DirectionType.Vertical)
1082                     {
1083                         warningSlidedTrackImage.SizeWidth = (float)trackThickness.Value;
1084                     }
1085                 }
1086             }
1087         }
1088
1089         private uint privateSpaceBetweenTrackAndIndicator
1090         {
1091             get
1092             {
1093                 return privateTrackPadding.Start;
1094             }
1095             set
1096             {
1097                 ushort val = (ushort)value;
1098                 privateTrackPadding = new Extents(val, val, val, val);
1099             }
1100         }
1101
1102         private Extents privateTrackPadding
1103         {
1104             get
1105             {
1106                 return spaceBetweenTrackAndIndicator;
1107             }
1108             set
1109             {
1110                 spaceBetweenTrackAndIndicator.CopyFrom(value);
1111                 UpdateComponentByIndicatorTypeChanged();
1112                 UpdateBgTrackSize();
1113                 UpdateBgTrackPosition();
1114                 UpdateValue();
1115             }
1116         }
1117
1118         /// <summary>
1119         /// Focus gained callback.
1120         /// </summary>
1121         /// <since_tizen> 8 </since_tizen>
1122         public override void OnFocusGained()
1123         {
1124             //State = ControlStates.Focused;
1125             UpdateState(true, isPressed);
1126             base.OnFocusGained();
1127         }
1128
1129         /// <summary>
1130         /// Focus Lost callback.
1131         /// </summary>
1132         /// <since_tizen> 8 </since_tizen>
1133         public override void OnFocusLost()
1134         {
1135             //State = ControlStates.Normal;
1136             UpdateState(false, isPressed);
1137             base.OnFocusLost();
1138         }
1139
1140         /// <inheritdoc/>
1141         [EditorBrowsable(EditorBrowsableState.Never)]
1142         public override bool OnKey(Key key)
1143         {
1144             if (!IsEnabled || null == key)
1145             {
1146                 return false;
1147             }
1148
1149             if (key.State == Key.StateType.Down)
1150             {
1151                 if ((direction == DirectionType.Horizontal && key.KeyPressedName == "Left") ||
1152                     (direction == DirectionType.Vertical && key.KeyPressedName == "Down"))
1153                 {
1154                     if (MinValue < CurrentValue)
1155                     {
1156                         isPressed = true;
1157                         if (IsDiscrete)
1158                         {
1159                             float value = CurrentValue - discreteValue;
1160                             CurrentValue = value < MinValue ? MinValue : value;
1161                         }
1162                         else
1163                         {
1164                             CurrentValue -= 1;
1165                         }
1166                         return true; // Consumed
1167                     }
1168                 }
1169                 else if ((direction == DirectionType.Horizontal && key.KeyPressedName == "Right") ||
1170                          (direction == DirectionType.Vertical && key.KeyPressedName == "Up"))
1171                 {
1172                     if (MaxValue > CurrentValue)
1173                     {
1174                         isPressed = true;
1175                         if (IsDiscrete)
1176                         {
1177                             float value = CurrentValue + discreteValue;
1178                             CurrentValue = value > MaxValue ? MaxValue : value;
1179                         }
1180                         else
1181                         {
1182                             CurrentValue += 1;
1183                         }
1184                         return true; // Consumed
1185                     }
1186                 }
1187             }
1188             else if (key.State == Key.StateType.Up)
1189             {
1190                 isPressed = false;
1191             }
1192
1193             return false;
1194         }
1195
1196         /// <summary>
1197         /// Apply style to scrollbar.
1198         /// </summary>
1199         /// <param name="viewStyle">The style to apply.</param>
1200         /// <since_tizen> 8 </since_tizen>
1201         public override void ApplyStyle(ViewStyle viewStyle)
1202         {
1203             base.ApplyStyle(viewStyle);
1204
1205             SliderStyle sliderStyle = viewStyle as SliderStyle;
1206
1207             if (null != sliderStyle?.Progress)
1208             {
1209                 CreateSlidedTrack().ApplyStyle(sliderStyle.Progress);
1210             }
1211
1212             if (null != sliderStyle?.LowIndicator)
1213             {
1214                 CreateLowIndicatorText().ApplyStyle(sliderStyle.LowIndicator);
1215             }
1216
1217             if (null != sliderStyle?.HighIndicator)
1218             {
1219                 CreateHighIndicatorText().ApplyStyle(sliderStyle.HighIndicator);
1220             }
1221
1222             if (null != sliderStyle?.Track)
1223             {
1224                 CreateBackgroundTrack().ApplyStyle(sliderStyle.Track);
1225             }
1226
1227             if (null != sliderStyle?.Thumb)
1228             {
1229                 CreateThumb().ApplyStyle(sliderStyle.Thumb);
1230             }
1231
1232             if (null != sliderStyle?.ValueIndicatorText)
1233             {
1234                 CreateValueIndicatorText().ApplyStyle(sliderStyle.ValueIndicatorText);
1235             }
1236
1237             if (null != sliderStyle?.ValueIndicatorImage)
1238             {
1239                 CreateValueIndicator().ApplyStyle(sliderStyle.ValueIndicatorImage);
1240             }
1241
1242             if (null != sliderStyle?.WarningTrack)
1243             {
1244                 CreateWarningTrack().ApplyStyle(sliderStyle.WarningTrack);
1245             }
1246
1247             if (null != sliderStyle?.WarningProgress)
1248             {
1249                 CreateWarningSlidedTrack().ApplyStyle(sliderStyle.WarningProgress);
1250             }
1251
1252             EnableControlStatePropagation = true;
1253         }
1254
1255         /// <summary>
1256         /// Prevents from showing child widgets in AT-SPI tree.
1257         /// </summary>
1258         [EditorBrowsable(EditorBrowsableState.Never)]
1259         protected override bool AccessibilityShouldReportZeroChildren()
1260         {
1261             return true;
1262         }
1263
1264         /// <summary>
1265         /// Gets minimum value for Accessibility.
1266         /// </summary>
1267         [EditorBrowsable(EditorBrowsableState.Never)]
1268         protected override double AccessibilityGetMinimum()
1269         {
1270             return (double)MinValue;
1271         }
1272
1273         /// <summary>
1274         /// Gets the current value for Accessibility.
1275         /// </summary>
1276         [EditorBrowsable(EditorBrowsableState.Never)]
1277         protected override double AccessibilityGetCurrent()
1278         {
1279             return (double)CurrentValue;
1280         }
1281
1282         /// <summary>
1283         /// Gets maximum value for Accessibility.
1284         /// </summary>
1285         [EditorBrowsable(EditorBrowsableState.Never)]
1286         protected override double AccessibilityGetMaximum()
1287         {
1288             return (double)MaxValue;
1289         }
1290
1291         /// <summary>
1292         /// Sets the current value using Accessibility.
1293         /// </summary>
1294         [EditorBrowsable(EditorBrowsableState.Never)]
1295         protected override bool AccessibilitySetCurrent(double value)
1296         {
1297             var current = (float)value;
1298
1299             if (current >= MinValue && current <= MaxValue)
1300             {
1301                 CurrentValue = current;
1302                 if (sliderValueChangedHandler != null)
1303                 {
1304                     sliderValueChangedHandler(this, new SliderValueChangedEventArgs { CurrentValue = current });
1305                 }
1306                 return true;
1307             }
1308
1309             return false;
1310         }
1311
1312         /// <summary>
1313         /// Gets minimum increment for Accessibility.
1314         /// </summary>
1315         [EditorBrowsable(EditorBrowsableState.Never)]
1316         protected override double AccessibilityGetMinimumIncrement()
1317         {
1318             // FIXME
1319             return (MaxValue - MinValue) / 20.0;
1320         }
1321
1322         /// <summary>
1323         /// Initialize AT-SPI object.
1324         /// </summary>
1325         [EditorBrowsable(EditorBrowsableState.Never)]
1326         public override void OnInitialize()
1327         {
1328             base.OnInitialize();
1329             SetAccessibilityConstructor(Role.Slider, AccessibilityInterface.Value);
1330         }
1331
1332         /// <summary>
1333         /// Get Slider style.
1334         /// </summary>
1335         /// <returns>The default slider style.</returns>
1336         /// <since_tizen> 8 </since_tizen>
1337         protected override ViewStyle CreateViewStyle()
1338         {
1339             return new SliderStyle();
1340         }
1341
1342         /// <summary>
1343         /// Dispose Slider.
1344         /// </summary>
1345         /// <param name="type">Dispose type.</param>
1346         /// <since_tizen> 6 </since_tizen>
1347         protected override void Dispose(DisposeTypes type)
1348         {
1349             if (disposed)
1350             {
1351                 return;
1352             }
1353
1354             if (type == DisposeTypes.Explicit)
1355             {
1356                 if (null != panGestureDetector)
1357                 {
1358                     panGestureDetector.Detach(this);
1359                     panGestureDetector.Detected -= OnPanGestureDetected;
1360                     panGestureDetector.Dispose();
1361                     panGestureDetector = null;
1362                 }
1363
1364                 if (null != thumbImage)
1365                 {
1366                     thumbImage.TouchEvent -= OnTouchEventForThumb;
1367                     Utility.Dispose(thumbImage);
1368                 }
1369                 Utility.Dispose(warningSlidedTrackImage);
1370                 Utility.Dispose(warningTrackImage);
1371                 Utility.Dispose(slidedTrackImage);
1372                 Utility.Dispose(bgTrackImage);
1373                 Utility.Dispose(lowIndicatorImage);
1374                 Utility.Dispose(highIndicatorImage);
1375                 Utility.Dispose(lowIndicatorText);
1376                 Utility.Dispose(highIndicatorText);
1377                 Utility.Dispose(valueIndicatorImage);
1378                 Utility.Dispose(valueIndicatorText);
1379
1380                 this.TouchEvent -= OnTouchEventForTrack;
1381             }
1382
1383             base.Dispose(type);
1384         }
1385
1386         /// <summary>
1387         /// Update Slider by style.
1388         /// </summary>
1389         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
1390         [EditorBrowsable(EditorBrowsableState.Never)]
1391         protected override void OnUpdate()
1392         {
1393             RelayoutBaseComponent();
1394
1395             UpdateComponentByIndicatorTypeChanged();
1396             UpdateBgTrackSize();
1397             UpdateBgTrackPosition();
1398             UpdateWarningTrackSize();
1399             UpdateLowIndicatorSize();
1400             UpdateValue();
1401         }
1402
1403         private void CalculateCurrentValueByGesture(float offset)
1404         {
1405             currentSlidedOffset += offset;
1406
1407             if (currentSlidedOffset <= 0)
1408             {
1409                 this.CurrentValue = minValue;
1410             }
1411             else if (currentSlidedOffset >= BgTrackLength())
1412             {
1413                 this.CurrentValue = maxValue;
1414             }
1415             else
1416             {
1417                 int bgTrackLength = BgTrackLength();
1418                 if (bgTrackLength != 0)
1419                 {
1420                     this.CurrentValue = ((currentSlidedOffset / (float)bgTrackLength) * (float)(maxValue - minValue)) + minValue;
1421                 }
1422             }
1423
1424             if (IsDiscrete)
1425             {
1426                 this.CurrentValue = CalculateDiscreteValue(this.CurrentValue);
1427             }
1428
1429             if (valueChangedHandler != null)
1430             {
1431                 ValueChangedArgs args = new ValueChangedArgs();
1432                 args.CurrentValue = this.CurrentValue;
1433                 valueChangedHandler(this, args);
1434             }
1435
1436             if (sliderValueChangedHandler != null)
1437             {
1438                 SliderValueChangedEventArgs args = new SliderValueChangedEventArgs();
1439                 args.CurrentValue = this.CurrentValue;
1440                 sliderValueChangedHandler(this, args);
1441             }
1442         }
1443
1444         private bool OnTouchEventForTrack(object source, TouchEventArgs e)
1445         {
1446             if (!IsEnabled)
1447             {
1448                 return false;
1449             }
1450
1451             PointStateType state = e.Touch.GetState(0);
1452             if (state == PointStateType.Down)
1453             {
1454                 if (isValueShown)
1455                 {
1456                     valueIndicatorImage.Show();
1457                 }
1458
1459                 Vector2 pos = e.Touch.GetLocalPosition(0);
1460                 CalculateCurrentValueByTouch(pos);
1461                 UpdateValue();
1462                 if (null != slidingFinishedHandler)
1463                 {
1464                     SlidingFinishedArgs args = new SlidingFinishedArgs();
1465                     args.CurrentValue = curValue;
1466                     slidingFinishedHandler(this, args);
1467                 }
1468
1469                 if (null != sliderSlidingFinishedHandler)
1470                 {
1471                     SliderSlidingFinishedEventArgs args = new SliderSlidingFinishedEventArgs();
1472                     args.CurrentValue = curValue;
1473                     sliderSlidingFinishedHandler(this, args);
1474                 }
1475             }
1476             else if (state == PointStateType.Up)
1477             {
1478                 if (isValueShown)
1479                 {
1480                     valueIndicatorImage.Hide();
1481                 }
1482             }
1483             return false;
1484         }
1485
1486         private bool OnTouchEventForThumb(object source, TouchEventArgs e)
1487         {
1488             PointStateType state = e.Touch.GetState(0);
1489             if (state == PointStateType.Down)
1490             {
1491                 UpdateState(isFocused, true);
1492             }
1493             else if (state == PointStateType.Up)
1494             {
1495                 UpdateState(isFocused, false);
1496             }
1497             return true;
1498         }
1499
1500         private void CalculateCurrentValueByTouch(Vector2 pos)
1501         {
1502             int bgTrackLength = BgTrackLength();
1503             if (direction == DirectionType.Horizontal)
1504             {
1505                 currentSlidedOffset = pos.X;
1506             }
1507             else if (direction == DirectionType.Vertical)
1508             {
1509                 currentSlidedOffset = bgTrackLength - pos.Y;
1510             }
1511
1512             if (bgTrackLength != 0)
1513             {
1514                 this.CurrentValue = ((currentSlidedOffset / (float)bgTrackLength) * (maxValue - minValue)) + minValue;
1515
1516                 if (IsDiscrete)
1517                 {
1518                     this.CurrentValue = CalculateDiscreteValue(this.CurrentValue);
1519                 }
1520
1521                 if (null != valueChangedHandler)
1522                 {
1523                     ValueChangedArgs args = new ValueChangedArgs();
1524                     args.CurrentValue = this.CurrentValue;
1525                     valueChangedHandler(this, args);
1526                 }
1527
1528                 if (null != sliderValueChangedHandler)
1529                 {
1530                     SliderValueChangedEventArgs args = new SliderValueChangedEventArgs();
1531                     args.CurrentValue = this.CurrentValue;
1532                     sliderValueChangedHandler(this, args);
1533                 }
1534             }
1535         }
1536
1537         private float CalculateDiscreteValue(float value)
1538         {
1539             return ((float)Math.Round((value / discreteValue)) * discreteValue);
1540         }
1541
1542         private void UpdateState(bool isFocusedNew, bool isPressedNew)
1543         {
1544             if (isFocused == isFocusedNew && isPressed == isPressedNew)
1545             {
1546                 return;
1547             }
1548             if (thumbImage == null || Style == null)
1549             {
1550                 return;
1551             }
1552             isFocused = isFocusedNew;
1553             isPressed = isPressedNew;
1554
1555             if(!IsEnabled) // Disabled
1556             {
1557                 ControlState = ControlState.Disabled;
1558
1559                 if (stateChangedHandler != null)
1560                 {
1561                     StateChangedArgs args = new StateChangedArgs();
1562                     args.CurrentState = (ControlStates)ControlStates.Disabled;
1563                     stateChangedHandler(this, args);
1564                 }
1565             }
1566             else if (!isFocused && !isPressed)
1567             {
1568                 ControlState = ControlState.Normal;
1569
1570                 if (stateChangedHandler != null)
1571                 {
1572                     StateChangedArgs args = new StateChangedArgs();
1573                     args.CurrentState = (ControlStates)ControlStates.Normal;
1574                     stateChangedHandler(this, args);
1575                 }
1576             }
1577             else if (isPressed)
1578             {
1579                 ControlState = ControlState.Pressed;
1580
1581                 if (stateChangedHandler != null)
1582                 {
1583                     StateChangedArgs args = new StateChangedArgs();
1584                     args.CurrentState = (ControlStates)ControlStates.Pressed;
1585                     stateChangedHandler(this, args);
1586                 }
1587             }
1588             else if (!isPressed && isFocused)
1589             {
1590                 ControlState = ControlState.Focused;
1591
1592                 if (stateChangedHandler != null)
1593                 {
1594                     StateChangedArgs args = new StateChangedArgs();
1595                     args.CurrentState = (ControlStates)ControlStates.Focused;
1596                     stateChangedHandler(this, args);
1597                 }
1598             }
1599         }
1600
1601         private void UpdateComponentByIndicatorTypeChanged()
1602         {
1603             IndicatorType type = CurrentIndicatorType();
1604             if (type == IndicatorType.None)
1605             {
1606                 if (lowIndicatorImage != null)
1607                 {
1608                     lowIndicatorImage.Hide();
1609                 }
1610                 if (highIndicatorImage != null)
1611                 {
1612                     highIndicatorImage.Hide();
1613                 }
1614                 if (lowIndicatorText != null)
1615                 {
1616                     lowIndicatorText.Hide();
1617                 }
1618                 if (highIndicatorText != null)
1619                 {
1620                     highIndicatorText.Hide();
1621                 }
1622             }
1623             else if (type == IndicatorType.Image)
1624             {
1625                 if (lowIndicatorImage != null)
1626                 {
1627                     lowIndicatorImage.Show();
1628                 }
1629                 if (highIndicatorImage != null)
1630                 {
1631                     highIndicatorImage.Show();
1632                 }
1633                 if (lowIndicatorText != null)
1634                 {
1635                     lowIndicatorText.Hide();
1636                 }
1637                 if (highIndicatorText != null)
1638                 {
1639                     highIndicatorText.Hide();
1640                 }
1641             }
1642             else if (type == IndicatorType.Text)
1643             {
1644                 if (lowIndicatorText != null)
1645                 {
1646                     lowIndicatorText.Show();
1647                 }
1648                 if (highIndicatorText != null)
1649                 {
1650                     highIndicatorText.Show();
1651                 }
1652                 if (lowIndicatorImage != null)
1653                 {
1654                     lowIndicatorImage.Hide();
1655                 }
1656                 if (highIndicatorImage != null)
1657                 {
1658                     highIndicatorImage.Hide();
1659                 }
1660             }
1661         }
1662
1663         /// <summary>
1664         /// Value Changed event data.
1665         /// </summary>
1666         /// <since_tizen> 6 </since_tizen>
1667         [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderValueChangedEventArgs instead.")]
1668         [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
1669         public class ValueChangedArgs : EventArgs
1670         {
1671             /// <summary>
1672             /// Current value
1673             /// </summary>
1674             /// <since_tizen> 6 </since_tizen>
1675             /// It will be removed in API10
1676             [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
1677             [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderValueChangedEventArgs.CurrentValue instead.")]
1678             public float CurrentValue;
1679         }
1680
1681         /// <summary>
1682         /// Value Changed event data.
1683         /// </summary>
1684         /// <since_tizen> 6 </since_tizen>
1685         [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderSlidingFinishedEventArgs instead.")]
1686         [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
1687         public class SlidingFinishedArgs : EventArgs
1688         {
1689             /// <summary>
1690             /// Current value
1691             /// </summary>
1692             /// <since_tizen> 6 </since_tizen>
1693             /// It will be removed in API10
1694             [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
1695             [Obsolete("Deprecated in API8; Will be removed in API10. Please use SliderSlidingFinishedEventArgs.CurrentValue instead.")]
1696             public float CurrentValue;
1697         }
1698
1699         /// <summary>
1700         /// State Changed event data.
1701         /// </summary>
1702         /// <since_tizen> 6 </since_tizen>
1703         [Obsolete("Deprecated in API8; Will be removed in API10. Please use View.ControlStateChangedEventArgs")]
1704         [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
1705         public class StateChangedArgs : EventArgs
1706         {
1707             /// <summary>
1708             /// Current state
1709             /// </summary>
1710             /// <since_tizen> 6 </since_tizen>
1711             /// It will be removed in API10
1712             [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
1713             [Obsolete("Deprecated in API8; Will be removed in API10")]
1714             public ControlStates CurrentState;
1715         }
1716     }
1717 }