Fix controls created by xaml issues (#341)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / UIComponents / Slider.cs
index 89de3c0..59eef13 100755 (executable)
@@ -757,11 +757,26 @@ namespace Tizen.NUI.UIComponents
         public Slider() : this(NDalicPINVOKE.Slider_New(), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
 
-            this.ValueChanged += (obj, e) => {
-                this.Value = e.SlideValue;
-                return true;
-            };
+        internal override bool IsCreateByXaml
+        {
+            get
+            {
+                return base.IsCreateByXaml;
+            }
+            set
+            {
+                base.IsCreateByXaml = value;
+
+                if (value == true)
+                {
+                    this.ValueChanged += (obj, e) => {
+                        this.Value = e.SlideValue;
+                        return true;
+                    };
+                }
+            }
         }
 
         internal Slider(Slider handle) : this(NDalicPINVOKE.new_Slider__SWIG_1(Slider.getCPtr(handle)), true)