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