[NUI] Fix button layout when resize policy is FillToParent and etc. (#2809)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / Button.cs
index 2b86dd1..96021fb 100755 (executable)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 using System;
 using System.ComponentModel;
  */
 using System;
 using System.ComponentModel;
+using System.Diagnostics;
 using Tizen.NUI.BaseComponents;
 using Tizen.NUI.Binding;
 using Tizen.NUI.BaseComponents;
 using Tizen.NUI.Binding;
+using Tizen.NUI.Accessibility;
 
 namespace Tizen.NUI.Components
 {
     /// <summary>
 
 namespace Tizen.NUI.Components
 {
     /// <summary>
+    /// ClickedEventArgs is a class to record button click event arguments which will sent to user.
+    /// </summary>
+    /// <since_tizen> 8 </since_tizen>
+    public class ClickedEventArgs : EventArgs
+    {
+    }
+
+    /// <summary>
+    /// SelectedChangedEventArgs is a class to record item selected arguments which will sent to user.
+    /// </summary>
+    /// <since_tizen> 8 </since_tizen>
+    public class SelectedChangedEventArgs : EventArgs
+    {
+        /// <summary> Selected state </summary>
+        /// <since_tizen> 8 </since_tizen>
+        public bool IsSelected { get; set; }
+    }
+
+    /// <summary>
     /// Button is one kind of common component, a button clearly describes what action will occur when the user selects it.
     /// Button may contain text or an icon.
     /// </summary>
     /// <since_tizen> 6 </since_tizen>
     /// Button is one kind of common component, a button clearly describes what action will occur when the user selects it.
     /// Button may contain text or an icon.
     /// </summary>
     /// <since_tizen> 6 </since_tizen>
-    public class Button : Control
+    public partial class Button : Control
     {
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create(nameof(IconRelativeOrientation), typeof(IconOrientation?), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
     {
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create(nameof(IconRelativeOrientation), typeof(IconOrientation?), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (newValue != null)
+            var newIconOrientation = (IconOrientation?)newValue;
+            if (instance.iconRelativeOrientation != newIconOrientation)
             {
             {
-                instance.privateIconRelativeOrientation = (IconOrientation?)newValue;
+                instance.iconRelativeOrientation = newIconOrientation;
+                instance.LayoutItems();
             }
         },
             }
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.privateIconRelativeOrientation;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).iconRelativeOrientation
+        );
+
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create(nameof(IsEnabled), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
@@ -50,14 +71,16 @@ namespace Tizen.NUI.Components
             var instance = (Button)bindable;
             if (newValue != null)
             {
             var instance = (Button)bindable;
             if (newValue != null)
             {
-                instance.privateIsEnabled = (bool)newValue;
+                bool newEnabled = (bool)newValue;
+                if (instance.isEnabled != newEnabled)
+                {
+                    instance.isEnabled = newEnabled;
+                    instance.Sensitive = newEnabled;
+                    instance.UpdateState();
+                }
             }
         },
             }
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.privateIsEnabled;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).isEnabled);
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create(nameof(IsSelected), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create(nameof(IsSelected), typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) =>
@@ -65,13 +88,22 @@ namespace Tizen.NUI.Components
             var instance = (Button)bindable;
             if (newValue != null)
             {
             var instance = (Button)bindable;
             if (newValue != null)
             {
-                instance.privateIsSelected = (bool)newValue;
+                bool newSelected = (bool)newValue;
+                if (instance.isSelected != newSelected)
+                {
+                    instance.isSelected = newSelected;
+
+                    if (instance.isSelectable)
+                    {
+                        instance.UpdateState();
+                    }
+                }
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Button)bindable;
             }
         },
         defaultValueCreator: (bindable) =>
         {
             var instance = (Button)bindable;
-            return instance.privateIsSelected;
+            return instance.isSelectable && instance.isSelected;
         });
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         });
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
@@ -80,57 +112,70 @@ namespace Tizen.NUI.Components
             var instance = (Button)bindable;
             if (newValue != null)
             {
             var instance = (Button)bindable;
             if (newValue != null)
             {
-                instance.privateIsSelectable = (bool)newValue;
+                bool newSelectable = (bool)newValue;
+                if (instance.isSelectable != newSelectable)
+                {
+                    instance.isSelectable = newSelectable;
+                    instance.UpdateState();
+                }
             }
         },
             }
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.privateIsSelectable;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).isSelectable);
+
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IconPaddingProperty = BindableProperty.Create(nameof(IconPadding), typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty IconPaddingProperty = BindableProperty.Create(nameof(IconPadding), typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (null != newValue && null != instance.Style?.IconPadding)
+            if (instance.buttonIcon == null)
             {
             {
-                instance.Style.IconPadding.CopyFrom((Extents)newValue);
-                instance.UpdateUIContent();
+                return;
             }
             }
+            instance.buttonIcon.Padding = (Extents)newValue;
         },
         },
-        defaultValueCreator: (bindable) =>
-        {
-            var instance = (Button)bindable;
-            return instance.Style?.IconPadding;
-        });
+        defaultValueCreator: (bindable) => ((Button)bindable).buttonIcon?.Padding);
+
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TextPaddingProperty = BindableProperty.Create(nameof(TextPadding), typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static readonly BindableProperty TextPaddingProperty = BindableProperty.Create(nameof(TextPadding), typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
-            if (null != newValue && null != instance.Style?.TextPadding)
+            if (instance.buttonText == null)
             {
             {
-                instance.Style.TextPadding.CopyFrom((Extents)newValue);
-                instance.UpdateUIContent();
+                return;
             }
             }
+            instance.buttonText.Padding = (Extents)newValue;
         },
         },
-        defaultValueCreator: (bindable) =>
+        defaultValueCreator: (bindable) => ((Button)bindable).buttonText?.Padding);
+
+        /// <summary> The bindable property of ItemAlignment. </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        internal static readonly BindableProperty ItemAlignmentProperty = BindableProperty.Create(nameof(ItemAlignment), typeof(LinearLayout.Alignment), typeof(Button), LinearLayout.Alignment.Center, propertyChanged: (bindable, oldValue, newValue) =>
         {
             var instance = (Button)bindable;
         {
             var instance = (Button)bindable;
-            return instance.Style?.TextPadding;
-        });
-
-        private ImageView overlayImage;
-
-        private TextLabel buttonText;
-        private ImageControl buttonIcon;
+            instance.itemAlignment = (LinearLayout.Alignment)newValue;
+            instance.LayoutItems();
+        },
+        defaultValueCreator: (bindable) => ((Button)bindable).itemAlignment);
 
 
-        private EventHandler<StateChangedEventArgs> stateChangeHander;
+        /// <summary> The bindable property of ItemSpacing. </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        internal static readonly BindableProperty ItemSpacingProperty = BindableProperty.Create(nameof(ItemSpacing), typeof(Size2D), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) =>
+        {
+            var instance = (Button)bindable;
+            instance.itemSpacing = (Size2D)newValue;
+            instance.UpdateSizeAndSpacing();
+        },
+        defaultValueCreator: (bindable) => ((Button)bindable).itemSpacing);
 
 
+        private IconOrientation? iconRelativeOrientation = IconOrientation.Left;
         private bool isSelected = false;
         private bool isSelected = false;
+        private bool isSelectable = false;
         private bool isEnabled = true;
         private bool isEnabled = true;
-        private bool isPressed = false;
+        private Size2D itemSpacing;
+        private LinearLayout.Alignment itemAlignment;
+
+        static Button() { }
 
         /// <summary>
         /// Creates a new instance of a Button.
 
         /// <summary>
         /// Creates a new instance of a Button.
@@ -138,53 +183,68 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         public Button() : base()
         {
         /// <since_tizen> 6 </since_tizen>
         public Button() : base()
         {
-            Initialize();
         }
 
         /// <summary>
         /// Creates a new instance of a Button with style.
         /// </summary>
         /// <param name="style">Create Button by special style defined in UX.</param>
         }
 
         /// <summary>
         /// Creates a new instance of a Button with style.
         /// </summary>
         /// <param name="style">Create Button by special style defined in UX.</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public Button(string style) : base(style)
         {
         public Button(string style) : base(style)
         {
-            Initialize();
         }
 
         /// <summary>
         }
 
         /// <summary>
-        /// Creates a new instance of a Button with attributes.
+        /// Creates a new instance of a Button with style.
+        /// </summary>
+        /// <param name="buttonStyle">Create Button by style customized by user.</param>
+        /// <since_tizen> 8 </since_tizen>
+        public Button(ButtonStyle buttonStyle) : base(buttonStyle)
+        {
+        }
+
+        /// <summary>
+        /// Calculates current states for the button<br />
         /// </summary>
         /// </summary>
-        /// <param name="controlStyle">Create Button by attributes customized by user.</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public Button(ButtonStyle controlStyle) : base(controlStyle)
+        protected override AccessibilityStates AccessibilityCalculateStates()
         {
         {
-            Initialize();
+            var states = base.AccessibilityCalculateStates();
+            states.Set(AccessibilityState.Checked, this.IsSelected);
+            states.Set(AccessibilityState.Enabled, this.IsEnabled);
+            return states;
         }
 
         /// <summary>
         /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         }
 
         /// <summary>
         /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10. Please use Clicked event instead.")]
         public event EventHandler<ClickEventArgs> ClickEvent;
         public event EventHandler<ClickEventArgs> ClickEvent;
+
+        /// <summary>
+        /// An event for the button clicked signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+        /// </summary>
+        /// <since_tizen> 8 </since_tizen>
+        public event EventHandler<ClickedEventArgs> Clicked;
+
         /// <summary>
         /// An event for the button state changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// <summary>
         /// An event for the button state changed signal which can be used to subscribe or unsubscribe the event handler provided by the user.<br />
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10. Please use View.ControlStateChangedEvent")]
         public event EventHandler<StateChangedEventArgs> StateChangedEvent
         {
             add
             {
         public event EventHandler<StateChangedEventArgs> StateChangedEvent
         {
             add
             {
-                stateChangeHander += value;
+                stateChangeHandler += value;
             }
             remove
             {
             }
             remove
             {
-                stateChangeHander -= value;
+                stateChangeHandler -= value;
             }
         }
             }
         }
+
         /// <summary>
         /// Icon orientation.
         /// </summary>
         /// <summary>
         /// Icon orientation.
         /// </summary>
@@ -213,9 +273,70 @@ namespace Tizen.NUI.Components
             Right,
         }
 
             Right,
         }
 
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public new ButtonStyle Style => ViewStyle as ButtonStyle;
+        /// <summary>
+        /// Button's icon part.
+        /// </summary>
+        /// <since_tizen> 8 </since_tizen>
+        public ImageView Icon
+        {
+            get => buttonIcon;
+            internal set
+            {
+                buttonIcon = value;
+            }
+        }
+
+        /// <summary>
+        /// Button's overlay image part.
+        /// </summary>
+        /// <since_tizen> 8 </since_tizen>
+        public ImageView OverlayImage
+        {
+            get
+            {
+                if (null == overlayImage)
+                {
+                    overlayImage = CreateOverlayImage();
+                    if (null != Extension)
+                    {
+                        overlayImage = Extension.OnCreateOverlayImage(this, overlayImage);
+                    }
+                    if (null != overlayImage)
+                    {
+                        overlayImage.ExcludeLayouting = true;
+                        Add(overlayImage);
+                    }
+                }
+                return overlayImage;
+            }
+            internal set
+            {
+                overlayImage = value;
+            }
+        }
+
+        /// <summary>
+        /// Button's text part.
+        /// </summary>
+        /// <since_tizen> 8 </since_tizen>
+        public TextLabel TextLabel
+        {
+            get => buttonText;
+            internal set
+            {
+                buttonText = value;
+                AccessibilityManager.Instance.SetAccessibilityAttribute(this, AccessibilityManager.AccessibilityAttribute.Label, buttonText.Text);
+            }
+        }
+
+        /// <summary>
+        /// Return currently applied style.
+        /// </summary>
+        /// <remarks>
+        /// Modifying contents in style may cause unexpected behaviour.
+        /// </remarks>
+        /// <since_tizen> 8 </since_tizen>
+        public ButtonStyle Style => (ButtonStyle)(ViewStyle as ButtonStyle)?.Clone();
 
         /// <summary>
         /// The text of Button.
 
         /// <summary>
         /// The text of Button.
@@ -225,13 +346,15 @@ namespace Tizen.NUI.Components
         {
             get
             {
         {
             get
             {
-                return Style?.Text?.Text?.GetValue(ControlState);
+                return TextLabel.Text;
             }
             set
             {
             }
             set
             {
-                if (null != Style?.Text)
+                TextLabel.Text = value;
+
+                if (IsHighlighted && String.IsNullOrEmpty(AccessibilityName) && GetAccessibilityNameSignal().Empty())
                 {
                 {
-                    Style.Text.Text = value;
+                    EmitAccessibilityEvent(ObjectPropertyChangeEvent.Name);
                 }
             }
         }
                 }
             }
         }
@@ -252,18 +375,6 @@ namespace Tizen.NUI.Components
             }
         }
 
             }
         }
 
-        private bool privateIsSelectable
-        {
-            get
-            {
-                return Style?.IsSelectable ?? false;
-            }
-            set
-            {
-                Style.IsSelectable = value;
-            }
-        }
-
         /// <summary>
         /// Translate text string in Button.
         /// </summary>
         /// <summary>
         /// Translate text string in Button.
         /// </summary>
@@ -272,14 +383,11 @@ namespace Tizen.NUI.Components
         {
             get
             {
         {
             get
             {
-                return Style?.Text?.TranslatableText?.All;
+                return TextLabel.TranslatableText;
             }
             set
             {
             }
             set
             {
-                if (null != Style?.Text)
-                {
-                    Style.Text.TranslatableText = value;
-                }
+                TextLabel.TranslatableText = value;
             }
         }
 
             }
         }
 
@@ -291,14 +399,11 @@ namespace Tizen.NUI.Components
         {
             get
             {
         {
             get
             {
-                return Style?.Text?.PointSize?.All ?? 0;
+                return TextLabel.PointSize;
             }
             set
             {
             }
             set
             {
-                if (null != Style?.Text)
-                {
-                    Style.Text.PointSize = value;
-                }
+                TextLabel.PointSize = value;
             }
         }
 
             }
         }
 
@@ -310,16 +415,14 @@ namespace Tizen.NUI.Components
         {
             get
             {
         {
             get
             {
-                return Style?.Text?.FontFamily.All;
+                return TextLabel.FontFamily;
             }
             set
             {
             }
             set
             {
-                if (null != Style?.Text)
-                {
-                    Style.Text.FontFamily = value;
-                }
+                TextLabel.FontFamily = value;
             }
         }
             }
         }
+
         /// <summary>
         /// Text color in Button.
         /// </summary>
         /// <summary>
         /// Text color in Button.
         /// </summary>
@@ -328,16 +431,14 @@ namespace Tizen.NUI.Components
         {
             get
             {
         {
             get
             {
-                return Style?.Text?.TextColor?.All;
+                return TextLabel.TextColor;
             }
             set
             {
             }
             set
             {
-                if (null != Style?.Text)
-                {
-                    Style.Text.TextColor = value;
-                }
+                TextLabel.TextColor = value;
             }
         }
             }
         }
+
         /// <summary>
         /// Text horizontal alignment in Button.
         /// </summary>
         /// <summary>
         /// Text horizontal alignment in Button.
         /// </summary>
@@ -346,16 +447,14 @@ namespace Tizen.NUI.Components
         {
             get
             {
         {
             get
             {
-                return Style?.Text?.HorizontalAlignment ?? HorizontalAlignment.Center;
+                return TextLabel.HorizontalAlignment;
             }
             set
             {
             }
             set
             {
-                if (null != Style?.Text)
-                {
-                    Style.Text.HorizontalAlignment = value;
-                }
+                TextLabel.HorizontalAlignment = value;
             }
         }
             }
         }
+
         /// <summary>
         /// Icon image's resource url in Button.
         /// </summary>
         /// <summary>
         /// Icon image's resource url in Button.
         /// </summary>
@@ -364,99 +463,121 @@ namespace Tizen.NUI.Components
         {
             get
             {
         {
             get
             {
-                return Style?.Icon?.ResourceUrl?.All;
+                return Icon.ResourceUrl;
             }
             set
             {
             }
             set
             {
-                if (null != Style?.Icon)
-                {
-                    Style.Icon.ResourceUrl = value;
-                }
+                Icon.ResourceUrl = value;
             }
         }
 
             }
         }
 
-        private StringSelector textSelector = new StringSelector();
         /// <summary>
         /// Text string selector in Button.
         /// <summary>
         /// Text string selector in Button.
+        /// Getter returns copied selector value if exist, null otherwise.
+        /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public StringSelector TextSelector
         {
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public StringSelector TextSelector
         {
-            get
-            {
-                return textSelector;
-            }
+            get => buttonText == null ? null : new StringSelector((Selector<string>)buttonText.GetValue(TextLabel.TextSelectorProperty));
             set
             {
             set
             {
-                textSelector.Clone(value);
+                if (value == null || buttonText == null)
+                {
+                    throw new NullReferenceException("Button.TextSelector is null");
+                }
+                else
+                {
+                    buttonText.SetValue(TextLabel.TextSelectorProperty, value);
+                }
             }
         }
 
             }
         }
 
-        private StringSelector translatableTextSelector = new StringSelector();
         /// <summary>
         /// <summary>
-        /// Translateable text string selector in Button.
+        /// Translatable text string selector in Button.
+        /// Getter returns copied selector value if exist, null otherwise.
         /// </summary>
         /// </summary>
+        /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
         /// <since_tizen> 6 </since_tizen>
         public StringSelector TranslatableTextSelector
         {
         /// <since_tizen> 6 </since_tizen>
         public StringSelector TranslatableTextSelector
         {
-            get
-            {
-                return translatableTextSelector;
-            }
+            get => buttonText == null ? null : new StringSelector((Selector<string>)buttonText.GetValue(TextLabel.TranslatableTextSelectorProperty));
             set
             {
             set
             {
-                translatableTextSelector.Clone(value);
+                if (value == null || buttonText == null)
+                {
+                    throw new NullReferenceException("Button.TranslatableTextSelector is null");
+                }
+                else
+                {
+                    buttonText.SetValue(TextLabel.TranslatableTextSelectorProperty, value);
+                }
             }
         }
 
             }
         }
 
-        private ColorSelector textColorSelector = new ColorSelector();
         /// <summary>
         /// Text color selector in Button.
         /// <summary>
         /// Text color selector in Button.
+        /// Getter returns copied selector value if exist, null otherwise.
         /// </summary>
         /// </summary>
+        /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
         /// <since_tizen> 6 </since_tizen>
         public ColorSelector TextColorSelector
         {
         /// <since_tizen> 6 </since_tizen>
         public ColorSelector TextColorSelector
         {
-            get
-            {
-                return textColorSelector;
-            }
+            get => buttonText == null ? null : new ColorSelector((Selector<Color>)buttonText.GetValue(TextLabel.TextColorSelectorProperty));
             set
             {
             set
             {
-                textColorSelector.Clone(value);
+                if (value == null || buttonText == null)
+                {
+                    throw new NullReferenceException("Button.TextColorSelectorProperty is null");
+                }
+                else
+                {
+                    buttonText.SetValue(TextLabel.TextColorSelectorProperty, value);
+                }
             }
         }
 
             }
         }
 
-        private FloatSelector pointSizeSelector = new FloatSelector();
         /// <summary>
         /// Text font size selector in Button.
         /// <summary>
         /// Text font size selector in Button.
+        /// Getter returns copied selector value if exist, null otherwise.
         /// </summary>
         /// </summary>
+        /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
         /// <since_tizen> 6 </since_tizen>
         public FloatSelector PointSizeSelector
         {
         /// <since_tizen> 6 </since_tizen>
         public FloatSelector PointSizeSelector
         {
-            get
-            {
-                return pointSizeSelector;
-            }
+            get => buttonText == null ? null : new FloatSelector((Selector<float?>)buttonText.GetValue(TextLabel.PointSizeSelectorProperty));
             set
             {
             set
             {
-                pointSizeSelector.Clone(value);
+                if (value == null || buttonText == null)
+                {
+                    throw new NullReferenceException("Button.PointSizeSelector is null");
+                }
+                else
+                {
+                    buttonText.SetValue(TextLabel.PointSizeSelectorProperty, value);
+                }
             }
         }
 
             }
         }
 
-        private StringSelector iconURLSelector = new StringSelector();
         /// <summary>
         /// Icon image's resource url selector in Button.
         /// <summary>
         /// Icon image's resource url selector in Button.
+        /// Getter returns copied selector value if exist, null otherwise.
         /// </summary>
         /// </summary>
+        /// <exception cref="NullReferenceException">Thrown when setting null value.</exception>
         /// <since_tizen> 6 </since_tizen>
         public StringSelector IconURLSelector
         {
         /// <since_tizen> 6 </since_tizen>
         public StringSelector IconURLSelector
         {
-            get
-            {
-                return iconURLSelector;
-            }
+            get => buttonIcon == null ? null : new StringSelector((Selector<string>)buttonIcon.GetValue(ImageView.ResourceUrlSelectorProperty));
             set
             {
             set
             {
-                iconURLSelector.Clone(value);
+                if (value == null || buttonIcon == null)
+                {
+                    throw new NullReferenceException("Button.IconURLSelector is null");
+                }
+                else
+                {
+                    buttonIcon.SetValue(ImageView.ResourceUrlSelectorProperty, value);
+                }
             }
         }
 
             }
         }
 
@@ -475,18 +596,7 @@ namespace Tizen.NUI.Components
                 SetValue(IsSelectedProperty, value);
             }
         }
                 SetValue(IsSelectedProperty, value);
             }
         }
-        private bool privateIsSelected
-        {
-            get
-            {
-                return isSelected;
-            }
-            set
-            {
-                isSelected = value;
-                UpdateState();
-            }
-        }
+
         /// <summary>
         /// Flag to decide enable or disable in Button.
         /// </summary>
         /// <summary>
         /// Flag to decide enable or disable in Button.
         /// </summary>
@@ -502,102 +612,65 @@ namespace Tizen.NUI.Components
                 SetValue(IsEnabledProperty, value);
             }
         }
                 SetValue(IsEnabledProperty, value);
             }
         }
-        private bool privateIsEnabled
-        {
-            get
-            {
-                return isEnabled;
-            }
-            set
-            {
-                isEnabled = value;
-                UpdateState();
-            }
-        }
 
         /// <summary>
         /// Icon relative orientation in Button, work only when show icon and text.
         /// </summary>
 
         /// <summary>
         /// Icon relative orientation in Button, work only when show icon and text.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public IconOrientation? IconRelativeOrientation
         {
             get
             {
         public IconOrientation? IconRelativeOrientation
         {
             get
             {
-                return (IconOrientation?)GetValue(IconRelativeOrientationProperty);
+                return (IconOrientation?)GetValue(IconRelativeOrientationProperty) ?? IconOrientation.Left;
             }
             set
             {
                 SetValue(IconRelativeOrientationProperty, value);
             }
         }
             }
             set
             {
                 SetValue(IconRelativeOrientationProperty, value);
             }
         }
-        private IconOrientation? privateIconRelativeOrientation
-        {
-            get
-            {
-                return Style?.IconRelativeOrientation;
-            }
-            set
-            {
-                if(Style != null && Style.IconRelativeOrientation != value)
-                {
-                    Style.IconRelativeOrientation = value;
-                    UpdateUIContent();
-                }
-            }
-        }
 
         /// <summary>
 
         /// <summary>
-        /// Icon padding in Button, work only when show icon and text.
+        /// Icon padding in Button. It is shortcut of Icon.Padding.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public Extents IconPadding
         {
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public Extents IconPadding
         {
-            get => (Extents)GetValue(IconPaddingProperty);
+            get => (Extents)GetValue(IconPaddingProperty) ?? new Extents();
             set => SetValue(IconPaddingProperty, value);
         }
 
         /// <summary>
             set => SetValue(IconPaddingProperty, value);
         }
 
         /// <summary>
-        /// Text padding in Button, work only when show icon and text.
+        /// Text padding in Button. It is shortcut of TextLabel.Padding.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public Extents TextPadding
         {
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         public Extents TextPadding
         {
-            get => (Extents) GetValue(TextPaddingProperty);
+            get => (Extents)GetValue(TextPaddingProperty) ?? new Extents();
             set => SetValue(TextPaddingProperty, value);
         }
 
         /// <summary>
             set => SetValue(TextPaddingProperty, value);
         }
 
         /// <summary>
-        /// Dispose Button and all children on it.
+        /// The item (text or icon or both) alignment.
         /// </summary>
         /// </summary>
-        /// <param name="type">Dispose type.</param>
-        /// <since_tizen> 6 </since_tizen>
-        protected override void Dispose(DisposeTypes type)
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public LinearLayout.Alignment ItemAlignment
         {
         {
-            if (disposed)
-            {
-                return;
-            }
-
-            if (type == DisposeTypes.Explicit)
-            {
-                if (buttonIcon != null)
-                {
-                    Utility.Dispose(buttonIcon);
-                }
-                if (buttonText != null)
-                {
-                    Utility.Dispose(buttonText);
-                }
-                if (overlayImage != null)
-                {
-                    Utility.Dispose(overlayImage);
-                }
-            }
+            get => (LinearLayout.Alignment)GetValue(ItemAlignmentProperty);
+            set => SetValue(ItemAlignmentProperty, value);
+        }
 
 
-            base.Dispose(type);
+        /// <summary>
+        /// The space between icon and text.
+        /// The value is applied when there exist icon and text both.
+        /// The width value is used when the items are arranged horizontally. Otherwise, the height value is used.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Size2D ItemSpacing
+        {
+            get => (Size2D)GetValue(ItemSpacingProperty);
+            set => SetValue(ItemSpacingProperty, value);
         }
         }
+
         /// <summary>
         /// Called after a key event is received by the view that has had its focus set.
         /// </summary>
         /// <summary>
         /// Called after a key event is received by the view that has had its focus set.
         /// </summary>
@@ -606,30 +679,41 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         public override bool OnKey(Key key)
         {
         /// <since_tizen> 6 </since_tizen>
         public override bool OnKey(Key key)
         {
-            if (null == key) return false;
+            if (!IsEnabled || null == key)
+            {
+                return false;
+            }
+
             if (key.State == Key.StateType.Down)
             {
                 if (key.KeyPressedName == "Return")
                 {
                     isPressed = true;
                     UpdateState();
             if (key.State == Key.StateType.Down)
             {
                 if (key.KeyPressedName == "Return")
                 {
                     isPressed = true;
                     UpdateState();
-                    if(isEnabled)
-                    {
-                        ClickEventArgs eventArgs = new ClickEventArgs();
-                        OnClick(eventArgs);
-                    }
                 }
             }
             else if (key.State == Key.StateType.Up)
             {
                 if (key.KeyPressedName == "Return")
                 {
                 }
             }
             else if (key.State == Key.StateType.Up)
             {
                 if (key.KeyPressedName == "Return")
                 {
+                    bool clicked = isPressed && IsEnabled;
+
                     isPressed = false;
                     isPressed = false;
-                    if (Style.IsSelectable != null && Style.IsSelectable == true)
+
+                    if (IsSelectable)
                     {
                     {
-                        isSelected = !isSelected;
+                        IsSelected = !IsSelected;
+                    }
+                    else
+                    {
+                        UpdateState();
+                    }
+
+                    if (clicked)
+                    {
+                        ClickedEventArgs eventArgs = new ClickedEventArgs();
+                        OnClickedInternal(eventArgs);
                     }
                     }
-                    UpdateState();
                 }
             }
             return base.OnKey(key);
                 }
             }
             return base.OnKey(key);
@@ -638,9 +722,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// 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.
         /// </summary>
         /// <summary>
         /// 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.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public override void OnFocusGained()
         {
             base.OnFocusGained();
         public override void OnFocusGained()
         {
             base.OnFocusGained();
@@ -650,9 +732,7 @@ namespace Tizen.NUI.Components
         /// <summary>
         /// 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.
         /// </summary>
         /// <summary>
         /// 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.
         /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
         public override void OnFocusLost()
         {
             base.OnFocusLost();
         public override void OnFocusLost()
         {
             base.OnFocusLost();
@@ -660,368 +740,98 @@ namespace Tizen.NUI.Components
         }
 
         /// <summary>
         }
 
         /// <summary>
-        /// Tap gesture event callback.
-        /// </summary>
-        /// <param name="source">Source which recieved touch event.</param>
-        /// <param name="e">Tap gesture event argument.</param>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e)
-        {
-            if (isEnabled)
-            {
-                ClickEventArgs eventArgs = new ClickEventArgs();
-                OnClick(eventArgs);
-                base.OnTapGestureDetected(source, e);
-            }
-        }
-        /// <summary>
         /// Called after a touch event is received by the owning view.<br />
         /// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
         /// </summary>
         /// <param name="touch">The touch event.</param>
         /// <returns>True if the event should be consumed.</returns>
         /// Called after a touch event is received by the owning view.<br />
         /// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
         /// </summary>
         /// <param name="touch">The touch event.</param>
         /// <returns>True if the event should be consumed.</returns>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <since_tizen> 8 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10. Please use OnClicked instead.")]
+#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member, It will be removed in API10
         public override bool OnTouch(Touch touch)
         public override bool OnTouch(Touch touch)
+#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member, It will be removed in API10
         {
         {
-            if (null == touch) return false;
-            PointStateType state = touch.GetState(0);
-
-            switch(state)
-            {
-                case PointStateType.Down:
-                    isPressed = true;
-                    UpdateState();
-                    return true;
-                case PointStateType.Interrupted:
-                    isPressed = false;
-                    UpdateState();
-                    return true;
-                case PointStateType.Up:
-                    isPressed = false;
-                    if (Style.IsSelectable != null && Style.IsSelectable == true)
-                    {
-                        isSelected = !isSelected;
-                    }
-                    UpdateState();
-                    return true;
-                default:
-                    break;
-            }
             return base.OnTouch(touch);
         }
 
             return base.OnTouch(touch);
         }
 
-        /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
+        /// <summary>
+        /// Apply style to button.
+        /// </summary>
+        /// <param name="viewStyle">The style to apply.</param>
+        /// <since_tizen> 8 </since_tizen>
         public override void ApplyStyle(ViewStyle viewStyle)
         {
         public override void ApplyStyle(ViewStyle viewStyle)
         {
-            base.ApplyStyle(viewStyle);
+            Debug.Assert(buttonIcon != null && buttonText != null);
 
 
-            ButtonStyle buttonStyle = viewStyle as ButtonStyle;
+            styleApplied = false;
 
 
-            if (null != buttonStyle)
+            base.ApplyStyle(viewStyle);
+
+            if (viewStyle is ButtonStyle buttonStyle)
             {
             {
-                if (null == overlayImage)
-                {
-                    overlayImage = new ImageView()
-                    {
-                        WidthResizePolicy = ResizePolicyType.FillToParent,
-                        HeightResizePolicy = ResizePolicyType.FillToParent
-                    };
-                    this.Add(overlayImage);
-                }
+                Extension = buttonStyle.CreateExtension();
 
 
-                if (null == buttonText)
-                {
-                    buttonText = new TextLabel();
-                    this.Add(buttonText);
+                if (buttonStyle.Overlay != null)
+                {   
+                    OverlayImage?.ApplyStyle(buttonStyle.Overlay);
                 }
 
                 }
 
-                if (null == buttonIcon)
+                if (Extension != null)
                 {
                 {
-                    buttonIcon = new ImageControl();
-                    this.Add(buttonIcon);
-                }
-
-                overlayImage.ApplyStyle(buttonStyle.Overlay);
-                buttonText.ApplyStyle(buttonStyle.Text);
-                buttonIcon.ApplyStyle(buttonStyle.Icon);
-            }
-        }
-
-        /// <summary>
-        /// Get Button attribues.
-        /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override ViewStyle GetViewStyle()
-        {
-            return new ButtonStyle();
-        }
-
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnUpdate()
-        {
-            base.OnUpdate();
-            UpdateUIContent();
-        }
+                    buttonIcon.Unparent();
+                    buttonIcon = Extension.OnCreateIcon(this, buttonIcon);
 
 
-        /// <summary>
-        /// Update Button State.
-        /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected void UpdateState()
-        {
-            ControlStates sourceState = ControlState;
-            ControlStates targetState;
+                    buttonText.Unparent();
+                    buttonText = Extension.OnCreateText(this, buttonText);
 
 
-            if(isEnabled)
-            {
-                targetState = isPressed ? ControlStates.Pressed : (IsFocused ? (IsSelected ? ControlStates.SelectedFocused : ControlStates.Focused) : (IsSelected ? ControlStates.Selected : ControlStates.Normal));
-            }
-            else
-            {
-                targetState = IsSelected ? ControlStates.DisabledSelected : (IsFocused ? ControlStates.DisabledFocused : ControlStates.Disabled);
-            }
-
-            if(sourceState != targetState)
-            {
-                ControlState = targetState;
+                    LayoutItems();
+                }
 
 
-                OnUpdate();
+                if (buttonStyle.Text != null)
+                {
+                    buttonText.ApplyStyle(buttonStyle.Text);
+                }
 
 
-                StateChangedEventArgs e = new StateChangedEventArgs
+                if (buttonStyle.Icon != null)
                 {
                 {
-                    PreviousState = sourceState,
-                    CurrentState = targetState
-                };
-                stateChangeHander?.Invoke(this, e);
+                    buttonIcon.ApplyStyle(buttonStyle.Icon);
+                }
             }
             }
-        }
 
 
-        /// <summary>
-        /// It is hijack by using protected, attributes copy problem when class inherited from Button.
-        /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        private void Initialize()
-        {
-            if (null == Style.IconRelativeOrientation) Style.IconRelativeOrientation = IconOrientation.Left;
+            styleApplied = true;
             UpdateState();
             UpdateState();
-            LayoutDirectionChanged += OnLayoutDirectionChanged;
-        }
-
-        /// <summary>
-        /// Measure text, it can be override.
-        /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected virtual void MeasureText()
-        {
-            if (Style.IconRelativeOrientation == null || buttonIcon == null || buttonText == null)
-            {
-                return;
-            }
-            buttonText.WidthResizePolicy = ResizePolicyType.Fixed;
-            buttonText.HeightResizePolicy = ResizePolicyType.Fixed;
-            int textPaddingStart = Style.TextPadding.Start;
-            int textPaddingEnd = Style.TextPadding.End;
-            int textPaddingTop = Style.TextPadding.Top;
-            int textPaddingBottom = Style.TextPadding.Bottom;
-
-            int iconPaddingStart = Style.IconPadding.Start;
-            int iconPaddingEnd = Style.IconPadding.End;
-            int iconPaddingTop = Style.IconPadding.Top;
-            int iconPaddingBottom = Style.IconPadding.Bottom;
-
-            if (IconRelativeOrientation == IconOrientation.Top || IconRelativeOrientation == IconOrientation.Bottom)
-            {
-                buttonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd;
-                buttonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom - iconPaddingTop - iconPaddingBottom - buttonIcon.SizeHeight;
-            }
-            else
-            {
-                buttonText.SizeWidth = SizeWidth - textPaddingStart - textPaddingEnd - iconPaddingStart - iconPaddingEnd - buttonIcon.SizeWidth;
-                buttonText.SizeHeight = SizeHeight - textPaddingTop - textPaddingBottom;
-            }
-        }
-        /// <summary>
-        /// Layout child, it can be override.
-        /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected virtual void LayoutChild()
-        {
-            if (Style.IconRelativeOrientation == null || buttonIcon == null || buttonText == null)
-            {
-                return;
-            }
-
-            int textPaddingStart = Style.TextPadding.Start;
-            int textPaddingEnd = Style.TextPadding.End;
-            int textPaddingTop = Style.TextPadding.Top;
-            int textPaddingBottom = Style.TextPadding.Bottom;
-
-            int iconPaddingStart = Style.IconPadding.Start;
-            int iconPaddingEnd = Style.IconPadding.End;
-            int iconPaddingTop = Style.IconPadding.Top;
-            int iconPaddingBottom = Style.IconPadding.Bottom;
-
-            switch (IconRelativeOrientation)
-            {
-                case IconOrientation.Top:
-                    buttonIcon.PositionUsesPivotPoint = true;
-                    buttonIcon.ParentOrigin = NUI.ParentOrigin.TopCenter;
-                    buttonIcon.PivotPoint = NUI.PivotPoint.TopCenter;
-                    buttonIcon.Position2D = new Position2D(0, iconPaddingTop);
-
-                    buttonText.PositionUsesPivotPoint = true;
-                    buttonText.ParentOrigin = NUI.ParentOrigin.BottomCenter;
-                    buttonText.PivotPoint = NUI.PivotPoint.BottomCenter;
-                    buttonText.Position2D = new Position2D(0, -textPaddingBottom);
-                    break;
-                case IconOrientation.Bottom:
-                    buttonIcon.PositionUsesPivotPoint = true;
-                    buttonIcon.ParentOrigin = NUI.ParentOrigin.BottomCenter;
-                    buttonIcon.PivotPoint = NUI.PivotPoint.BottomCenter;
-                    buttonIcon.Position2D = new Position2D(0, -iconPaddingBottom);
-
-                    buttonText.PositionUsesPivotPoint = true;
-                    buttonText.ParentOrigin = NUI.ParentOrigin.TopCenter;
-                    buttonText.PivotPoint = NUI.PivotPoint.TopCenter;
-                    buttonText.Position2D = new Position2D(0, textPaddingTop);
-                    break;
-                case IconOrientation.Left:
-                    if (LayoutDirection == ViewLayoutDirectionType.LTR)
-                    {
-                        buttonIcon.PositionUsesPivotPoint = true;
-                        buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterLeft;
-                        buttonIcon.PivotPoint = NUI.PivotPoint.CenterLeft;
-                        buttonIcon.Position2D = new Position2D(iconPaddingStart, 0);
-
-                        buttonText.PositionUsesPivotPoint = true;
-                        buttonText.ParentOrigin = NUI.ParentOrigin.CenterRight;
-                        buttonText.PivotPoint = NUI.PivotPoint.CenterRight;
-                        buttonText.Position2D = new Position2D(-textPaddingEnd, 0);
-                    }
-                    else
-                    {
-                        buttonIcon.PositionUsesPivotPoint = true;
-                        buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterRight;
-                        buttonIcon.PivotPoint = NUI.PivotPoint.CenterRight;
-                        buttonIcon.Position2D = new Position2D(-iconPaddingStart, 0);
-
-                        buttonText.PositionUsesPivotPoint = true;
-                        buttonText.ParentOrigin = NUI.ParentOrigin.CenterLeft;
-                        buttonText.PivotPoint = NUI.PivotPoint.CenterLeft;
-                        buttonText.Position2D = new Position2D(textPaddingEnd, 0);
-                    }
-
-                    break;
-                case IconOrientation.Right:
-                    if (LayoutDirection == ViewLayoutDirectionType.RTL)
-                    {
-                        buttonIcon.PositionUsesPivotPoint = true;
-                        buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterLeft;
-                        buttonIcon.PivotPoint = NUI.PivotPoint.CenterLeft;
-                        buttonIcon.Position2D = new Position2D(iconPaddingEnd, 0);
-
-                        buttonText.PositionUsesPivotPoint = true;
-                        buttonText.ParentOrigin = NUI.ParentOrigin.CenterRight;
-                        buttonText.PivotPoint = NUI.PivotPoint.CenterRight;
-                        buttonText.Position2D = new Position2D(-textPaddingStart, 0);
-                    }
-                    else
-                    {
-                        buttonIcon.PositionUsesPivotPoint = true;
-                        buttonIcon.ParentOrigin = NUI.ParentOrigin.CenterRight;
-                        buttonIcon.PivotPoint = NUI.PivotPoint.CenterRight;
-                        buttonIcon.Position2D = new Position2D(-iconPaddingEnd, 0);
-
-                        buttonText.PositionUsesPivotPoint = true;
-                        buttonText.ParentOrigin = NUI.ParentOrigin.CenterLeft;
-                        buttonText.PivotPoint = NUI.PivotPoint.CenterLeft;
-                        buttonText.Position2D = new Position2D(textPaddingStart, 0);
-                    }
-                    break;
-                default:
-                    break;
-            }
-            if (string.IsNullOrEmpty(buttonText.Text))
-            {
-                buttonIcon.ParentOrigin = NUI.ParentOrigin.Center;
-                buttonIcon.PivotPoint = NUI.PivotPoint.Center;
-            }
-        }
-        /// <summary>
-        /// Theme change callback when theme is changed, this callback will be trigger.
-        /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e)
-        {
-            ButtonStyle tempAttributes = StyleManager.Instance.GetViewStyle(style) as ButtonStyle;
-            if (tempAttributes != null)
-            {
-                Style.CopyFrom(tempAttributes);
-                UpdateUIContent();
-            }
-        }
-
-        private void UpdateUIContent()
-        {
-            MeasureText();
-            LayoutChild();
-
-            Sensitive = isEnabled;
-        }
-
-        private void OnLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e)
-        {
-            MeasureText();
-            LayoutChild();
-        }
-
-        private void OnClick(ClickEventArgs eventArgs)
-        {
-            ClickEvent?.Invoke(this, eventArgs);
-        }
-
-        private void OnIconRelayout(object sender, EventArgs e)
-        {
-            MeasureText();
-            LayoutChild();
         }
 
         /// <summary>
         /// ClickEventArgs is a class to record button click event arguments which will sent to user.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         }
 
         /// <summary>
         /// ClickEventArgs is a class to record button click event arguments which will sent to user.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10. Please use ClickedEventArgs instead.")]
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
         public class ClickEventArgs : EventArgs
         {
         }
         public class ClickEventArgs : EventArgs
         {
         }
+
         /// <summary>
         /// StateChangeEventArgs is a class to record button state change event arguments which will sent to user.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
         /// <summary>
         /// StateChangeEventArgs is a class to record button state change event arguments which will sent to user.
         /// </summary>
         /// <since_tizen> 6 </since_tizen>
+        [Obsolete("Deprecated in API8; Will be removed in API10. Please use View.ControlStateChangedEventArgs")]
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
         public class StateChangedEventArgs : EventArgs
         {
             /// <summary> previous state of Button </summary>
             /// <since_tizen> 6 </since_tizen>
         public class StateChangedEventArgs : EventArgs
         {
             /// <summary> previous state of Button </summary>
             /// <since_tizen> 6 </since_tizen>
+            /// It will be removed in API10
+            [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
+            [Obsolete("Deprecated in API8; Will be removed in API10")]
             public ControlStates PreviousState;
             /// <summary> current state of Button </summary>
             /// <since_tizen> 6 </since_tizen>
             public ControlStates PreviousState;
             /// <summary> current state of Button </summary>
             /// <since_tizen> 6 </since_tizen>
+            /// It will be removed in API10
+            [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:Do not declare visible instance fields")]
+            [Obsolete("Deprecated in API8; Will be removed in API10")]
             public ControlStates CurrentState;
         }
             public ControlStates CurrentState;
         }
-
     }
 }
     }
 }