[NUI] Fix failed in TCT
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / Switch.cs
old mode 100644 (file)
new mode 100755 (executable)
index 43bf732..b6e3b0d
@@ -27,7 +27,7 @@ namespace Tizen.NUI.Components
     /// The icon part consists of track and thumb.
     /// </summary>
     /// <since_tizen> 6 </since_tizen>
-    public class Switch : Button
+    public partial class Switch : Button
     {
         private ImageView thumb = null;
 
@@ -78,11 +78,11 @@ namespace Tizen.NUI.Components
         /// Informs AT-SPI bridge about the set of AT-SPI states associated with this object.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Never)]
-        protected override AccessibilityStates AccessibilityCalculateStates()
+        protected override AccessibilityStates AccessibilityCalculateStates(ulong states)
         {
-            var states = base.AccessibilityCalculateStates();
-            FlagSetter(ref states, AccessibilityStates.Checked, this.IsSelected);
-            return states;
+            var accessibilityStates = base.AccessibilityCalculateStates(states);
+            FlagSetter(ref accessibilityStates, AccessibilityStates.Checked, this.IsSelected);
+            return accessibilityStates;
         }
 
         /// <summary>
@@ -172,7 +172,19 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         public StringSelector SwitchBackgroundImageURLSelector
         {
-            get => new StringSelector(Icon.ResourceUrlSelector);
+            get
+            {
+                return GetValue(SwitchBackgroundImageURLSelectorProperty) as StringSelector;
+            }
+            set
+            {
+                SetValue(SwitchBackgroundImageURLSelectorProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+        private StringSelector InternalSwitchBackgroundImageURLSelector
+        {
+            get => Icon?.ResourceUrlSelector == null ? null : new StringSelector(Icon.ResourceUrlSelector);
             set
             {
                 Debug.Assert(Icon != null);
@@ -188,6 +200,18 @@ namespace Tizen.NUI.Components
         {
             get
             {
+                return GetValue(SwitchHandlerImageURLProperty) as string;
+            }
+            set
+            {
+                SetValue(SwitchHandlerImageURLProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+        private string InternalSwitchHandlerImageURL
+        {
+            get
+            {
                 return Thumb.ResourceUrl;
             }
             set
@@ -203,6 +227,18 @@ namespace Tizen.NUI.Components
         /// <since_tizen> 6 </since_tizen>
         public StringSelector SwitchHandlerImageURLSelector
         {
+            get
+            {
+                return GetValue(SwitchHandlerImageURLSelectorProperty) as StringSelector;
+            }
+            set
+            {
+                SetValue(SwitchHandlerImageURLSelectorProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+        private StringSelector InternalSwitchHandlerImageURLSelector
+        {
             get => new StringSelector(thumb.ResourceUrlSelector);
             set
             {
@@ -219,6 +255,18 @@ namespace Tizen.NUI.Components
         {
             get
             {
+                return GetValue(SwitchHandlerImageSizeProperty) as Size;
+            }
+            set
+            {
+                SetValue(SwitchHandlerImageSizeProperty, value);
+                NotifyPropertyChanged();
+            }
+        }
+        private Size InternalSwitchHandlerImageSize
+        {
+            get
+            {
                 return Thumb.Size;
             }
             set