[NUI] Delete warning messages
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / Button.cs
1 /*
2  * Copyright(c) 2020 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 System.ComponentModel;
19 using Tizen.NUI.BaseComponents;
20 using Tizen.NUI.Binding;
21 using Tizen.NUI.Components.Extension;
22 using Tizen.NUI.Accessibility;
23
24 namespace Tizen.NUI.Components
25 {
26     /// <summary>
27     /// ClickedEventArgs is a class to record button click event arguments which will sent to user.
28     /// </summary>
29     /// <since_tizen> 8 </since_tizen>
30     public class ClickedEventArgs : EventArgs
31     {
32     }
33
34     /// <summary>
35     /// SelectedChangedEventArgs is a class to record item selected arguments which will sent to user.
36     /// </summary>
37     /// <since_tizen> 8 </since_tizen>
38     public class SelectedChangedEventArgs : EventArgs
39     {
40         /// <summary> Selected state </summary>
41         /// <since_tizen> 8 </since_tizen>
42         public bool IsSelected { get; set; }
43     }
44
45     /// <summary>
46     /// Button is one kind of common component, a button clearly describes what action will occur when the user selects it.
47     /// Button may contain text or an icon.
48     /// </summary>
49     /// <since_tizen> 6 </since_tizen>
50     public partial class Button : Control
51     {
52         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
53         [EditorBrowsable(EditorBrowsableState.Never)]
54         public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create(nameof(IconRelativeOrientation), typeof(IconOrientation?), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
55         {
56             var instance = (Button)bindable;
57             var newIconOrientation = (IconOrientation?)newValue;
58             if (instance.iconRelativeOrientation != newIconOrientation)
59             {
60                 instance.iconRelativeOrientation = newIconOrientation;
61                 instance.UpdateUIContent();
62             }
63         },
64         defaultValueCreator: (bindable) => ((Button)bindable).iconRelativeOrientation
65         );
66
67         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
68         [EditorBrowsable(EditorBrowsableState.Never)]
69         public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
70         {
71             var instance = (Button)bindable;
72             if (newValue != null)
73             {
74                 bool newEnabled = (bool)newValue;
75                 if (instance.isEnabled != newEnabled)
76                 {
77                     instance.isEnabled = newEnabled;
78
79                     if (instance.buttonStyle != null)
80                     {
81                         instance.buttonStyle.IsEnabled = newEnabled;
82                     }
83
84                     instance.UpdateState();
85                 }
86             }
87         },
88         defaultValueCreator: (bindable) => ((Button)bindable).isEnabled);
89         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
90         [EditorBrowsable(EditorBrowsableState.Never)]
91         public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create(nameof(IsSelected), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
92         {
93             var instance = (Button)bindable;
94             if (newValue != null)
95             {
96                 bool newSelected = (bool)newValue;
97                 if (instance.isSelected != newSelected)
98                 {
99                     instance.isSelected = newSelected;
100
101                     if (instance.buttonStyle != null)
102                     {
103                         instance.buttonStyle.IsSelected = newSelected;
104                     }
105
106                     if (instance.isSelectable)
107                     {
108                         instance.UpdateState();
109                     }
110                 }
111             }
112         },
113         defaultValueCreator: (bindable) =>
114         {
115             var instance = (Button)bindable;
116             return instance.isSelectable && instance.isSelected;
117         });
118         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
119         [EditorBrowsable(EditorBrowsableState.Never)]
120         public static readonly BindableProperty IsSelectableProperty = BindableProperty.Create(nameof(IsSelectable), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
121         {
122             var instance = (Button)bindable;
123             if (newValue != null)
124             {
125                 bool newSelectable = (bool)newValue;
126                 if (instance.isSelectable != newSelectable)
127                 {
128                     instance.isSelectable = newSelectable;
129
130                     if (instance.buttonStyle != null)
131                     {
132                         instance.buttonStyle.IsSelectable = newSelectable;
133                     }
134
135                     instance.UpdateState();
136                 }
137             }
138         },
139         defaultValueCreator: (bindable) => ((Button)bindable).isSelectable);
140
141         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
142         [EditorBrowsable(EditorBrowsableState.Never)]
143         public static readonly BindableProperty IconPaddingProperty = BindableProperty.Create(nameof(IconPadding), typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
144         {
145             var instance = (Button)bindable;
146             instance.iconPadding = (Extents)((Extents)newValue).Clone();
147             instance.UpdateUIContent();
148         },
149         defaultValueCreator: (bindable) => ((Button)bindable).iconPadding);
150
151         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
152         [EditorBrowsable(EditorBrowsableState.Never)]
153         public static readonly BindableProperty TextPaddingProperty = BindableProperty.Create(nameof(TextPadding), typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
154         {
155             var instance = (Button)bindable;
156             instance.textPadding = (Extents)((Extents)newValue).Clone();
157             instance.UpdateUIContent();
158         },
159         defaultValueCreator: (bindable) => ((Button)bindable).textPadding);
160
161         private IconOrientation? iconRelativeOrientation;
162         private bool isSelected = false;
163         private bool isSelectable = false;
164         private bool isEnabled = true;
165         private Extents iconPadding;
166         private Extents textPadding;
167
168         static Button() { }
169
170         /// <summary>
171         /// Creates a new instance of a Button.
172         /// </summary>
173         /// <since_tizen> 6 </since_tizen>
174         public Button() : base()
175         {
176             Initialize();
177         }
178
179         /// <summary>
180         /// Creates a new instance of a Button with style.
181         /// </summary>
182         /// <param name="style">Create Button by special style defined in UX.</param>
183         /// <since_tizen> 8 </since_tizen>
184         public Button(string style) : base(style)
185         {
186             Initialize();
187         }
188
189         /// <summary>
190         /// Creates a new instance of a Button with style.
191         /// </summary>
192         /// <param name="buttonStyle">Create Button by style customized by user.</param>
193         /// <since_tizen> 8 </since_tizen>
194         public Button(ButtonStyle buttonStyle) : base(buttonStyle)
195         {
196             Initialize();
197         }
198
199         /// <summary>
200         /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
201         /// </summary>
202         /// <since_tizen> 6 </since_tizen>
203         [Obsolete("Deprecated in API8; Will be removed in API10. Please use Clicked event instead.")]
204         public event EventHandler<ClickEventArgs> ClickEvent;
205
206         /// <summary>
207         /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.
208         /// </summary>
209         /// <since_tizen> 8 </since_tizen>
210         public event EventHandler<ClickedEventArgs> Clicked;
211
212         /// <summary>
213         /// An event for the button state changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
214         /// </summary>
215         /// <since_tizen> 6 </since_tizen>
216         [Obsolete("Deprecated in API8; Will be removed in API10. Please use View.ControlStateChangedEvent")]
217         public event EventHandler<StateChangedEventArgs> StateChangedEvent
218         {
219             add
220             {
221                 stateChangeHandler += value;
222             }
223             remove
224             {
225                 stateChangeHandler -= value;
226             }
227         }
228
229         /// <summary>
230         /// Icon orientation.
231         /// </summary>
232         /// <since_tizen> 6 </since_tizen>
233         public enum IconOrientation
234         {
235             /// <summary>
236             /// Top.
237             /// </summary>
238             /// <since_tizen> 6 </since_tizen>
239             Top,
240             /// <summary>
241             /// Bottom.
242             /// </summary>
243             /// <since_tizen> 6 </since_tizen>
244             Bottom,
245             /// <summary>
246             /// Left.
247             /// </summary>
248             /// <since_tizen> 6 </since_tizen>
249             Left,
250             /// <summary>
251             /// Right.
252             /// </summary>
253             /// <since_tizen> 6 </since_tizen>
254             Right,
255         }
256
257         /// <summary>
258         /// Button's icon part.
259         /// </summary>
260         /// <since_tizen> 8 </since_tizen>
261         public ImageView Icon
262         {
263             get
264             {
265                 if (null == buttonIcon)
266                 {
267                     buttonIcon = CreateIcon();
268                     if (null != Extension)
269                     {
270                         buttonIcon = Extension.OnCreateIcon(this, buttonIcon);
271                     }
272                     if (null != buttonIcon)
273                     {
274                         Add(buttonIcon);
275                         buttonIcon.Relayout += OnIconRelayout;
276                     }
277                 }
278                 return buttonIcon;
279             }
280             internal set
281             {
282                 buttonIcon = value;
283             }
284         }
285
286         /// <summary>
287         /// Button's overlay image part.
288         /// </summary>
289         /// <since_tizen> 8 </since_tizen>
290         public ImageView OverlayImage
291         {
292             get
293             {
294                 if (null == overlayImage)
295                 {
296                     overlayImage = CreateOverlayImage();
297                     if (null != Extension)
298                     {
299                         overlayImage = Extension.OnCreateOverlayImage(this, overlayImage);
300                     }
301                     if (null != overlayImage)
302                     {
303                         Add(overlayImage);
304                     }
305                 }
306                 return overlayImage;
307             }
308             internal set
309             {
310                 overlayImage = value;
311             }
312         }
313
314         /// <summary>
315         /// Button's text part.
316         /// </summary>
317         /// <since_tizen> 8 </since_tizen>
318         public TextLabel TextLabel
319         {
320             get
321             {
322                 if (null == buttonText)
323                 {
324                     buttonText = CreateText();
325                     if (null != Extension)
326                     {
327                         buttonText = Extension.OnCreateText(this, buttonText);
328                     }
329                     if (null != buttonText)
330                     {
331                         Add(buttonText);
332                     }
333                 }
334                 return buttonText;
335             }
336             internal set
337             {
338                 buttonText = value;
339                 AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Label, buttonText.Text);
340             }
341         }
342
343         /// <summary>
344         /// Return a copied Style instance of Button
345         /// </summary>
346         /// <remarks>
347         /// It returns copied Style instance and changing it does not effect to the Button.
348         /// Style setting is possible by using constructor or the function of ApplyStyle(ViewStyle viewStyle)
349         /// </remarks>
350         /// <since_tizen> 8 </since_tizen>
351         public new ButtonStyle Style
352         {
353             get
354             {
355                 var result = (ButtonStyle)ViewStyle.Clone();
356                 result.CopyPropertiesFromView(this);
357                 result.Text.CopyPropertiesFromView(TextLabel);
358                 result.Icon.CopyPropertiesFromView(Icon);
359                 result.Overlay.CopyPropertiesFromView(OverlayImage);
360                 return result;
361             }
362         }
363
364         /// <summary>
365         /// The text of Button.
366         /// </summary>
367         /// <since_tizen> 6 </since_tizen>
368         public string Text
369         {
370             get
371             {
372                 return TextLabel.Text;
373             }
374             set
375             {
376                 TextLabel.Text = value;
377             }
378         }
379
380         /// <summary>
381         /// Flag to decide Button can be selected or not.
382         /// </summary>
383         /// <since_tizen> 6 </since_tizen>
384         public bool IsSelectable
385         {
386             get
387             {
388                 return (bool)GetValue(IsSelectableProperty);
389             }
390             set
391             {
392                 SetValue(IsSelectableProperty, value);
393             }
394         }
395
396         /// <summary>
397         /// Translate text string in Button.
398         /// </summary>
399         /// <since_tizen> 6 </since_tizen>
400         public string TranslatableText
401         {
402             get
403             {
404                 return TextLabel.TranslatableText;
405             }
406             set
407             {
408                 TextLabel.TranslatableText = value;
409             }
410         }
411
412         /// <summary>
413         /// Text point size in Button.
414         /// </summary>
415         /// <since_tizen> 6 </since_tizen>
416         public float PointSize
417         {
418             get
419             {
420                 return TextLabel.PointSize;
421             }
422             set
423             {
424                 TextLabel.PointSize = value;
425             }
426         }
427
428         /// <summary>
429         /// Text font family in Button.
430         /// </summary>
431         /// <since_tizen> 6 </since_tizen>
432         public string FontFamily
433         {
434             get
435             {
436                 return TextLabel.FontFamily;
437             }
438             set
439             {
440                 TextLabel.FontFamily = value;
441             }
442         }
443
444         /// <summary>
445         /// Text color in Button.
446         /// </summary>
447         /// <since_tizen> 6 </since_tizen>
448         public Color TextColor
449         {
450             get
451             {
452                 return TextLabel.TextColor;
453             }
454             set
455             {
456                 TextLabel.TextColor = value;
457             }
458         }
459
460         /// <summary>
461         /// Text horizontal alignment in Button.
462         /// </summary>
463         /// <since_tizen> 6 </since_tizen>
464         public HorizontalAlignment TextAlignment
465         {
466             get
467             {
468                 return TextLabel.HorizontalAlignment;
469             }
470             set
471             {
472                 TextLabel.HorizontalAlignment = value;
473             }
474         }
475
476         /// <summary>
477         /// Icon image's resource url in Button.
478         /// </summary>
479         /// <since_tizen> 6 </since_tizen>
480         public string IconURL
481         {
482             get
483             {
484                 return Icon.ResourceUrl;
485             }
486             set
487             {
488                 Icon.ResourceUrl = value;
489             }
490         }
491
492         /// <summary>
493         /// Text string selector in Button.
494         /// Getter returns copied selector value if exist, null otherwise.
495         /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
496         /// </summary>
497         /// <since_tizen> 6 </since_tizen>
498         public StringSelector TextSelector
499         {
500             get => buttonText == null ? null : new StringSelector((Selector<string>)buttonText.GetValue(TextLabel.TextSelectorProperty));
501             set
502             {
503                 if (value == null || buttonText == null)
504                 {
505                     throw new NullReferenceException("Button.TextSelector is null");
506                 }
507                 else
508                 {
509                     buttonText.SetValue(TextLabel.TextSelectorProperty, value);
510                 }
511             }
512         }
513
514         /// <summary>
515         /// Translateable text string selector in Button.
516         /// Getter returns copied selector value if exist, null otherwise.
517         /// </summary>
518         /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
519         /// <since_tizen> 6 </since_tizen>
520         public StringSelector TranslatableTextSelector
521         {
522             get => buttonText == null ? null : new StringSelector((Selector<string>)buttonText.GetValue(TextLabel.TranslatableTextSelectorProperty));
523             set
524             {
525                 if (value == null || buttonText == null)
526                 {
527                     throw new NullReferenceException("Button.TranslatableTextSelector is null");
528                 }
529                 else
530                 {
531                     buttonText.SetValue(TextLabel.TranslatableTextSelectorProperty, value);
532                 }
533             }
534         }
535
536         /// <summary>
537         /// Text color selector in Button.
538         /// Getter returns copied selector value if exist, null otherwise.
539         /// </summary>
540         /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
541         /// <since_tizen> 6 </since_tizen>
542         public ColorSelector TextColorSelector
543         {
544             get => buttonText == null ? null : new ColorSelector((Selector<Color>)buttonText.GetValue(TextLabel.TextColorSelectorProperty));
545             set
546             {
547                 if (value == null || buttonText == null)
548                 {
549                     throw new NullReferenceException("Button.TextColorSelectorProperty is null");
550                 }
551                 else
552                 {
553                     buttonText.SetValue(TextLabel.TextColorSelectorProperty, value);
554                 }
555             }
556         }
557
558         /// <summary>
559         /// Text font size selector in Button.
560         /// Getter returns copied selector value if exist, null otherwise.
561         /// </summary>
562         /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
563         /// <since_tizen> 6 </since_tizen>
564         public FloatSelector PointSizeSelector
565         {
566             get => buttonText == null ? null : new FloatSelector((Selector<float?>)buttonText.GetValue(TextLabel.PointSizeSelectorProperty));
567             set
568             {
569                 if (value == null || buttonText == null)
570                 {
571                     throw new NullReferenceException("Button.PointSizeSelector is null");
572                 }
573                 else
574                 {
575                     buttonText.SetValue(TextLabel.PointSizeSelectorProperty, value);
576                 }
577             }
578         }
579
580         /// <summary>
581         /// Icon image's resource url selector in Button.
582         /// Getter returns copied selector value if exist, null otherwise.
583         /// </summary>
584         /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
585         /// <since_tizen> 6 </since_tizen>
586         public StringSelector IconURLSelector
587         {
588             get => buttonIcon == null ? null : new StringSelector((Selector<string>)buttonIcon.GetValue(ImageView.ResourceUrlSelectorProperty));
589             set
590             {
591                 if (value == null || buttonIcon == null)
592                 {
593                     throw new NullReferenceException("Button.IconURLSelector is null");
594                 }
595                 else
596                 {
597                     buttonIcon.SetValue(ImageView.ResourceUrlSelectorProperty, value);
598                 }
599             }
600         }
601
602         /// <summary>
603         /// Flag to decide selected state in Button.
604         /// </summary>
605         /// <since_tizen> 6 </since_tizen>
606         public bool IsSelected
607         {
608             get
609             {
610                 return (bool)GetValue(IsSelectedProperty);
611             }
612             set
613             {
614                 SetValue(IsSelectedProperty, value);
615             }
616         }
617
618         /// <summary>
619         /// Flag to decide enable or disable in Button.
620         /// </summary>
621         /// <since_tizen> 6 </since_tizen>
622         public bool IsEnabled
623         {
624             get
625             {
626                 return (bool)GetValue(IsEnabledProperty);
627             }
628             set
629             {
630                 SetValue(IsEnabledProperty, value);
631             }
632         }
633
634         /// <summary>
635         /// Icon relative orientation in Button, work only when show icon and text.
636         /// </summary>
637         /// <since_tizen> 8 </since_tizen>
638         public IconOrientation? IconRelativeOrientation
639         {
640             get
641             {
642                 return (IconOrientation?)GetValue(IconRelativeOrientationProperty) ?? IconOrientation.Left;
643             }
644             set
645             {
646                 SetValue(IconRelativeOrientationProperty, value);
647             }
648         }
649
650         /// <summary>
651         /// Icon padding in Button, work only when show icon and text.
652         /// </summary>
653         /// <since_tizen> 6 </since_tizen>
654         public Extents IconPadding
655         {
656             get => (Extents)GetValue(IconPaddingProperty) ?? new Extents();
657             set => SetValue(IconPaddingProperty, value);
658         }
659
660         /// <summary>
661         /// Text padding in Button, work only when show icon and text.
662         /// </summary>
663         /// <since_tizen> 6 </since_tizen>
664         public Extents TextPadding
665         {
666             get => (Extents)GetValue(TextPaddingProperty) ?? new Extents();
667             set => SetValue(TextPaddingProperty, value);
668         }
669
670         private ButtonStyle buttonStyle => ViewStyle as ButtonStyle;
671
672         /// <summary>
673         /// Called after a key event is received by the view that has had its focus set.
674         /// </summary>
675         /// <param name="key">The key event.</param>
676         /// <returns>True if the key event should be consumed.</returns>
677         /// <since_tizen> 6 </since_tizen>
678         public override bool OnKey(Key key)
679         {
680             if (!IsEnabled || null == key)
681             {
682                 return false;
683             }
684
685             if (key.State == Key.StateType.Down)
686             {
687                 if (key.KeyPressedName == "Return")
688                 {
689                     isPressed = true;
690                     UpdateState();
691                 }
692             }
693             else if (key.State == Key.StateType.Up)
694             {
695                 if (key.KeyPressedName == "Return")
696                 {
697                     bool clicked = isPressed && IsEnabled;
698
699                     isPressed = false;
700
701                     if (IsSelectable)
702                     {
703                         IsSelected = !IsSelected;
704                     }
705                     else
706                     {
707                         UpdateState();
708                     }
709
710                     if (clicked)
711                     {
712                         ClickedEventArgs eventArgs = new ClickedEventArgs();
713                         OnClickedInternal(eventArgs);
714                     }
715                 }
716             }
717             return base.OnKey(key);
718         }
719
720         /// <summary>
721         /// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained.
722         /// </summary>
723         /// <since_tizen> 8 </since_tizen>
724         public override void OnFocusGained()
725         {
726             base.OnFocusGained();
727             UpdateState();
728         }
729
730         /// <summary>
731         /// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost.
732         /// </summary>
733         /// <since_tizen> 8 </since_tizen>
734         public override void OnFocusLost()
735         {
736             base.OnFocusLost();
737             UpdateState();
738         }
739
740         /// <summary>
741         /// Called after a touch event is received by the owning view.<br />
742         /// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
743         /// </summary>
744         /// <param name="touch">The touch event.</param>
745         /// <returns>True if the event should be consumed.</returns>
746         /// <since_tizen> 8 </since_tizen>
747         [Obsolete("Deprecated in API8; Will be removed in API10. Please use OnClicked instead.")]
748         public override bool OnTouch(Touch touch)
749         {
750             return base.OnTouch(touch);
751         }
752
753         /// <summary>
754         /// Apply style to button.
755         /// </summary>
756         /// <param name="viewStyle">The style to apply.</param>
757         /// <since_tizen> 8 </since_tizen>
758         public override void ApplyStyle(ViewStyle viewStyle)
759         {
760             styleApplied = false;
761
762             base.ApplyStyle(viewStyle);
763
764             if (null != buttonStyle)
765             {
766                 Extension = buttonStyle.CreateExtension();
767                 if (buttonStyle.Overlay != null)
768                 {
769                     OverlayImage?.ApplyStyle(buttonStyle.Overlay);
770                 }
771
772                 if (buttonStyle.Text != null)
773                 {
774                     TextLabel?.ApplyStyle(buttonStyle.Text);
775                 }
776
777                 if (buttonStyle.Icon != null)
778                 {
779                     Icon?.ApplyStyle(buttonStyle.Icon);
780                 }
781             }
782
783             styleApplied = true;
784         }
785
786         /// <summary>
787         /// ClickEventArgs is a class to record button click event arguments which will sent to user.
788         /// </summary>
789         /// <since_tizen> 6 </since_tizen>
790         [Obsolete("Deprecated in API8; Will be removed in API10. Please use ClickedEventArgs instead.")]
791         [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
792         public class ClickEventArgs : EventArgs
793         {
794         }
795
796         /// <summary>
797         /// StateChangeEventArgs is a class to record button state change event arguments which will sent to user.
798         /// </summary>
799         /// <since_tizen> 6 </since_tizen>
800         [Obsolete("Deprecated in API8; Will be removed in API10. Please use View.ControlStateChangedEventArgs")]
801         [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
802         public class StateChangedEventArgs : EventArgs
803         {
804             /// <summary> previous state of Button </summary>
805             /// <since_tizen> 6 </since_tizen>
806             /// It will be removed in API10
807             [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
808             [Obsolete("Deprecated in API8; Will be removed in API10")]
809             public ControlStates PreviousState;
810             /// <summary> current state of Button </summary>
811             /// <since_tizen> 6 </since_tizen>
812             /// It will be removed in API10
813             [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
814             [Obsolete("Deprecated in API8; Will be removed in API10")]
815             public ControlStates CurrentState;
816         }
817     }
818 }