[NUI] Add license, delete unnecessary code (#2679)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / XamlBinding / TemplateBinding.cs
index 551ae0b..57792cc 100755 (executable)
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 using System;
 using System.Globalization;
 
@@ -6,11 +22,11 @@ namespace Tizen.NUI.Binding
     internal class TemplateBinding : BindingBase
     {
         internal const string SelfPath = ".";
-        IValueConverter _converter;
-        object _converterParameter;
+        private IValueConverter converter;
+        private object converterParameter;
 
-        BindingExpression _expression;
-        string _path;
+        private BindingExpression expression;
+        private string path;
 
         public TemplateBinding()
         {
@@ -33,35 +49,35 @@ namespace Tizen.NUI.Binding
 
         public IValueConverter Converter
         {
-            get { return _converter; }
+            get { return converter; }
             set
             {
                 ThrowIfApplied();
 
-                _converter = value;
+                converter = value;
             }
         }
 
         public object ConverterParameter
         {
-            get { return _converterParameter; }
+            get { return converterParameter; }
             set
             {
                 ThrowIfApplied();
 
-                _converterParameter = value;
+                converterParameter = value;
             }
         }
 
         public string Path
         {
-            get { return _path; }
+            get { return path; }
             set
             {
                 ThrowIfApplied();
 
-                _path = value;
-                _expression = GetBindingExpression(value);
+                path = value;
+                expression = GetBindingExpression(value);
             }
         }
 
@@ -69,10 +85,10 @@ namespace Tizen.NUI.Binding
         {
             base.Apply(fromTarget);
 
-            if (_expression == null)
-                _expression = new BindingExpression(this, SelfPath);
+            if (expression == null)
+                expression = new BindingExpression(this, SelfPath);
 
-            _expression.Apply(fromTarget);
+            expression.Apply(fromTarget);
         }
 
         internal override async void Apply(object newContext, BindableObject bindObj, BindableProperty targetProperty, bool fromBindingContextChanged = false)
@@ -112,16 +128,16 @@ namespace Tizen.NUI.Binding
         {
             base.Unapply(fromBindingContextChanged: fromBindingContextChanged);
 
-            if (_expression != null)
-                _expression.Unapply();
+            if (expression != null)
+                expression.Unapply();
         }
 
         void ApplyInner(Element templatedParent, BindableObject bindableObject, BindableProperty targetProperty)
         {
-            if (_expression == null && templatedParent != null)
-                _expression = new BindingExpression(this, SelfPath);
+            if (expression == null && templatedParent != null)
+                expression = new BindingExpression(this, SelfPath);
 
-            _expression?.Apply(templatedParent, bindableObject, targetProperty);
+            expression?.Apply(templatedParent, bindableObject, targetProperty);
         }
 
         BindingExpression GetBindingExpression(string path)