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