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