[EXaml] Add code for load EXaml
authorFang Xiaohui <xiaohui.fang@samsung.com>
Fri, 16 Apr 2021 05:38:03 +0000 (13:38 +0800)
committerhuiyueun <35286162+huiyueun@users.noreply.github.com>
Tue, 20 Apr 2021 06:13:00 +0000 (15:13 +0900)
39 files changed:
src/Tizen.NUI/src/internal/EXaml/Action/Action.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/AddEventAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/AddExistInstanceAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/AddToResourceDictionary.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/CallAddMethodAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/CreateObjectAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/GatherBindablePropertiesAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/GetValueAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/GetValueListAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/RegisterXNameAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/SetBindalbePropertyAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/SetBindingAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/SetDynamicResourceAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Action/SetPropertyAction.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Block/GatherAssembliesBlock.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Block/GatherEventsBlock.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Block/GatherMethodsBlock.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Block/GatherPropertiesBlock.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Block/GatherTypesBlock.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/LoadEXaml.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/AddEvent.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/AddToResourceDictionary.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/CallAddMethod.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/CreateInstance.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/GatherAssembly.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/GatherBindableProperties.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/GatherConvertedValue.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/GatherEnumValue.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/GatherEvent.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/GatherMethod.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/GatherProperty.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/GatherType.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/Operation.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/RegisterXName.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/SetBindalbeProperty.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/SetBinding.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/SetDynamicResource.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/EXaml/Operation/SetProperty.cs [new file with mode: 0755]
src/Tizen.NUI/src/public/EXaml/EXamlExtensions.cs [new file with mode: 0755]

diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/Action.cs b/src/Tizen.NUI/src/internal/EXaml/Action/Action.cs
new file mode 100755 (executable)
index 0000000..9ae723a
--- /dev/null
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal interface Action
+    {
+        void Init();
+
+        void OnActive();
+
+        Action DealChar(char c);
+    }
+
+    internal class Instance
+    {
+        internal Instance(int index)
+        {
+            Index = index;
+        }
+        internal int Index
+        {
+            get;
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/AddEventAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/AddEventAction.cs
new file mode 100755 (executable)
index 0000000..4479b40
--- /dev/null
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class AddEventAction : Action
+    {
+        public AddEventAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '#':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            if (null != childOp)
+            {
+                int instanceIndex = (childOp.ValueList[0] as Instance).Index;
+                int elementIndex = (childOp.ValueList[1] as Instance).Index;
+                int propertyIndex = (int)childOp.ValueList[2];
+                int value = (int)childOp.ValueList[3];
+                LoadEXaml.Operations.Add(new AddEvent(instanceIndex, elementIndex, propertyIndex, value));
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/AddExistInstanceAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/AddExistInstanceAction.cs
new file mode 100755 (executable)
index 0000000..51ac229
--- /dev/null
@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class AddExistInstanceAction : Action
+    {
+        internal AddExistInstanceAction(Action parent)
+        {
+            this.parent = parent;
+        }
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '@':
+                    parent?.OnActive();
+                    return parent;
+
+                case '(':
+                    getValueListOp = new GetValueListAction(')', this);
+                    return getValueListOp;
+
+                case 'o':
+                case 'q':
+                    sign = c;
+                    break;
+            }
+
+            return this;
+        }
+
+        public void Init()
+        {
+        }
+
+        public void OnActive()
+        {
+            if (null != getValueListOp)
+            {
+                object value0 = getValueListOp.ValueList[0];
+                int index = (value0 is Instance) ? (value0 as Instance).Index : (int)value0;
+                string value = getValueListOp.ValueList[1] as string;
+
+                if ('q' == sign)
+                {
+                    LoadEXaml.Operations.Add(new GatherConvertedValue(index, value));
+                }
+                else if ('o' == sign)
+                {
+                    LoadEXaml.Operations.Add(new GatherEnumValue(index, value));
+                }
+
+                getValueListOp = null;
+            }
+        }
+
+        private char sign;
+        private GetValueListAction getValueListOp;
+
+        internal static object Root
+        {
+            get;
+            set;
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/AddToResourceDictionary.cs b/src/Tizen.NUI/src/internal/EXaml/Action/AddToResourceDictionary.cs
new file mode 100755 (executable)
index 0000000..08b9582
--- /dev/null
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class AddToResourceDictionaryAction : Action
+    {
+        public AddToResourceDictionaryAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '*':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            if (null != childOp)
+            {
+                int instanceIndex = (childOp.ValueList[0] as Instance).Index;
+                string key = childOp.ValueList[1] as string;
+                var value = childOp.ValueList[2];
+                LoadEXaml.Operations.Add(new AddToResourceDictionary(instanceIndex, key, value));
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/CallAddMethodAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/CallAddMethodAction.cs
new file mode 100755 (executable)
index 0000000..7e16aa0
--- /dev/null
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class CallAddMethodAction : Action
+    {
+        public CallAddMethodAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '^':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            if (null != childOp)
+            {
+                int parentIndex = (childOp.ValueList[0] as Instance).Index;
+                int childIndex = (childOp.ValueList[1] as Instance).Index;
+                int methodIndex = (int)childOp.ValueList[2];
+
+                LoadEXaml.Operations.Add(new CallAddMethod(parentIndex, childIndex, methodIndex));
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/CreateObjectAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/CreateObjectAction.cs
new file mode 100755 (executable)
index 0000000..0d147ec
--- /dev/null
@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class CreateObjectAction : Action
+    {
+        internal CreateObjectAction(Action parent)
+        {
+            this.parent = parent;
+        }
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '}':
+                    parent?.OnActive();
+                    return parent;
+
+                case '(':
+                    getParamListOp = new GetValueListAction(')', this);
+                    return getParamListOp;
+
+                default:
+                    getTypeIndexOp = new GetValueAction(c, this);
+                    return getTypeIndexOp;
+            }
+
+            return this;
+        }
+
+        public void Init()
+        {
+        }
+
+        public void OnActive()
+        {
+            if (null != getTypeIndexOp)
+            {
+                int typeIndex = (int)getTypeIndexOp.Value;
+                if (null == getParamListOp)
+                {
+                    LoadEXaml.Operations.Add(new CreateInstance(typeIndex));
+                }
+                else
+                {
+                    LoadEXaml.Operations.Add(new CreateInstance(typeIndex, getParamListOp.ValueList));
+                }
+                getParamListOp = null;
+            }
+
+            getTypeIndexOp = null;
+        }
+
+        private GetValueAction getTypeIndexOp;
+        private GetValueListAction getParamListOp;
+
+        internal static object Root
+        {
+            get
+            {
+                return CreateInstance.Root;
+            }
+            set
+            {
+                CreateInstance.Root = value;
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/GatherBindablePropertiesAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/GatherBindablePropertiesAction.cs
new file mode 100755 (executable)
index 0000000..172cb48
--- /dev/null
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherBindablePropertiesAction : Action
+    {
+        public GatherBindablePropertiesAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '>':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            int typeIndex = int.Parse(childOp.ValueList[0] as string);
+            string propertyName = childOp.ValueList[1] as string;
+
+            LoadEXaml.Operations.Add(new GatherBindableProperties(typeIndex, propertyName));
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/GetValueAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/GetValueAction.cs
new file mode 100755 (executable)
index 0000000..9afd51f
--- /dev/null
@@ -0,0 +1,193 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tizen.NUI.Binding;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GetValueAction : Action
+    {
+        public GetValueAction(char sign, Action parent)
+        {
+            this.sign = sign;
+            this.parent = parent;
+        }
+        private char sign;
+        private Action parent;
+
+        private delegate object GetValueByString(string value);
+
+        private static GetValueByString[] getValueByStrings = null;
+        private static GetValueByString[] GetValueByStrings
+        {
+            get
+            {
+                if (null == getValueByStrings)
+                {
+                    getValueByStrings = new GetValueByString['p' - 'a' + 2];
+
+                    getValueByStrings[0] = (string value) =>
+                    {
+                        return value;
+                    };
+
+                    //'a' -> 1 Ojbect
+                    getValueByStrings[1] = (string value) =>
+                    {
+                        int index = int.Parse(value);
+                        return new Instance(index);
+                    };
+
+                    //b SByte
+                    getValueByStrings[2] = (string value) =>
+                    {
+                        return SByte.Parse(value);
+                    };
+
+                    //c Int16
+                    getValueByStrings[3] = (string value) =>
+                    {
+                        return Int16.Parse(value);
+                    };
+
+                    //d Int32
+                    getValueByStrings[4] = (string value) =>
+                    {
+                        return Int32.Parse(value);
+                    };
+
+                    //e Int64
+                    getValueByStrings[5] = (string value) =>
+                    {
+                        return Int64.Parse(value);
+                    };
+
+                    //f Byte
+                    getValueByStrings[6] = (string value) =>
+                    {
+                        return Byte.Parse(value);
+                    };
+
+                    //g UInt16
+                    getValueByStrings[7] = (string value) =>
+                    {
+                        return UInt16.Parse(value);
+                    };
+
+                    //h UInt32
+                    getValueByStrings[8] = (string value) =>
+                    {
+                        return UInt32.Parse(value);
+                    };
+
+                    //i UInt64
+                    getValueByStrings[9] = (string value) =>
+                    {
+                        return UInt64.Parse(value);
+                    };
+
+                    //j Single
+                    getValueByStrings[10] = (string value) =>
+                    {
+                        return Single.Parse(value);
+                    };
+
+                    //k Double
+                    getValueByStrings[11] = (string value) =>
+                    {
+                        return Double.Parse(value);
+                    };
+
+                    //l Boolean
+                    getValueByStrings[12] = (string value) =>
+                    {
+                        return Boolean.Parse(value);
+                    };
+
+                    //m TimeSpan
+                    getValueByStrings[13] = (string value) =>
+                    {
+                        return TimeSpan.Parse(value);
+                    };
+
+                    //n decimal
+                    getValueByStrings[14] = (string value) =>
+                    {
+                        return decimal.Parse(value);
+                    };
+
+                    //o enum
+                    getValueByStrings[15] = (string value) =>
+                    {
+                        //Should be deal prev
+                        return null;
+                    };
+                }
+
+                return getValueByStrings;
+            }
+        }
+
+        public Action DealChar(char c)
+        {
+            if (c == sign)
+            {
+                switch (sign)
+                {
+                    case '\"':
+                        Value = GetValueByStrings[0](valueString);
+                        break;
+
+                    case 'z':
+                        Value = null;
+                        break;
+
+                    default:
+                        Value = GetValueByStrings[c - 'a' + 1](valueString);
+                        break;
+                }
+
+                parent?.OnActive();
+                return parent;
+            }
+
+            if ('\"' != sign)
+            {
+                switch (c)
+                {
+                    case ' ':
+                    case '\n':
+                    case '\r':
+                        return this;
+
+                    case '(':
+                        getValueList = new GetValueListAction(')', this);
+                        return getValueList;
+                }
+            }
+
+            valueString += c;
+
+            return this;
+        }
+
+        private string valueString;
+
+        private GetValueListAction getValueList;
+
+        public object Value
+        {
+            get;
+            private set;
+        }
+
+        public void Init()
+        {
+            valueString = "";
+        }
+
+        public void OnActive()
+        {
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/GetValueListAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/GetValueListAction.cs
new file mode 100755 (executable)
index 0000000..17eca18
--- /dev/null
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GetValueListAction : Action
+    {
+        public GetValueListAction(char sign, Action parent)
+        {
+            this.sign = sign;
+            this.parent = parent;
+        }
+        private char sign;
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            if (c == sign)
+            {
+                parent?.OnActive();
+                return parent;
+            }
+
+            if ('\"' != sign)
+            {
+                switch (c)
+                {
+                    case ' ':
+                    case '\n':
+                    case '\r':
+                        return this;
+
+                    case '(':
+                        childOp = new GetValueListAction(')', this);
+                        return childOp;
+
+                    default:
+                        childOp = new GetValueAction(c, this);
+                        return childOp;
+                }
+            }
+
+            return this;
+        }
+
+        internal List<object> ValueList
+        {
+            get;
+        } = new List<object>();
+
+        private Action childOp;
+
+        public void Init()
+        {
+            ValueList.Clear();
+        }
+
+        public void OnActive()
+        {
+            GetValueAction getValueAction;
+            GetValueListAction getValueListAction;
+
+            if (null != (getValueAction = (childOp as GetValueAction)))
+            {
+                ValueList.Add(getValueAction.Value);
+            }
+            else if (null != (getValueListAction = (childOp as GetValueListAction)))
+            {
+                ValueList.Add(getValueListAction.ValueList);
+            }
+
+            childOp = null;
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/RegisterXNameAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/RegisterXNameAction.cs
new file mode 100755 (executable)
index 0000000..546e552
--- /dev/null
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class RegisterXNameAction : Action
+    {
+        public RegisterXNameAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '&':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            object instance = childOp.ValueList[0];
+            string xName = childOp.ValueList[1] as string;
+
+            LoadEXaml.Operations.Add(new RegisterXName(instance, xName));
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/SetBindalbePropertyAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/SetBindalbePropertyAction.cs
new file mode 100755 (executable)
index 0000000..0bd8d0d
--- /dev/null
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class SetBindalbePropertyAction : Action
+    {
+        public SetBindalbePropertyAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '!':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            if (null != childOp)
+            {
+                int instanceIndex = (childOp.ValueList[0] as Instance).Index;
+                int bindalbePropertyIndex = (int)childOp.ValueList[1];
+                var value = childOp.ValueList[2];
+                LoadEXaml.Operations.Add(new SetBindalbeProperty(instanceIndex, bindalbePropertyIndex, value));
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/SetBindingAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/SetBindingAction.cs
new file mode 100755 (executable)
index 0000000..46375c4
--- /dev/null
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class SetBindingAction : Action
+    {
+        public SetBindingAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '%':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            if (null != childOp)
+            {
+                int instanceIndex = (childOp.ValueList[0] as Instance).Index;
+                var propertyIndex = (int)childOp.ValueList[1];
+                int valueIndex = (childOp.ValueList[2] as Instance).Index;
+
+                LoadEXaml.Operations.Add(new SetBinding(instanceIndex, propertyIndex, valueIndex));
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/SetDynamicResourceAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/SetDynamicResourceAction.cs
new file mode 100755 (executable)
index 0000000..6bca9b9
--- /dev/null
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class SetDynamicResourceAction : Action
+    {
+        public SetDynamicResourceAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '$':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            if (null != childOp)
+            {
+                int instanceIndex = (childOp.ValueList[0] as Instance).Index;
+                int propertyIndex = (int)childOp.ValueList[1];
+                string key = childOp.ValueList[2] as string;
+
+                LoadEXaml.Operations.Add(new SetDynamicResource(instanceIndex, propertyIndex, key));
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Action/SetPropertyAction.cs b/src/Tizen.NUI/src/internal/EXaml/Action/SetPropertyAction.cs
new file mode 100755 (executable)
index 0000000..f1bbf48
--- /dev/null
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class SetPropertyAction : Action
+    {
+        public SetPropertyAction(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case ']':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            if (null != childOp)
+            {
+                int instanceIndex = (childOp.ValueList[0] as Instance).Index;
+                int propertyIndex = (int)childOp.ValueList[1];
+                var value = childOp.ValueList[2];
+                LoadEXaml.Operations.Add(new SetProperty(instanceIndex, propertyIndex, value));
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Block/GatherAssembliesBlock.cs b/src/Tizen.NUI/src/internal/EXaml/Block/GatherAssembliesBlock.cs
new file mode 100755 (executable)
index 0000000..1f3ca19
--- /dev/null
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherAssembliesBlock : Action
+    {
+        public GatherAssembliesBlock(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '\"':
+                    childOp = new GetValueAction(c, this);
+                    return childOp;
+
+                case '>':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            var readedAssemblyName = childOp.Value as string;
+            LoadEXaml.Operations.Add(new GatherAssembly(readedAssemblyName));
+            childOp = null;
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Block/GatherEventsBlock.cs b/src/Tizen.NUI/src/internal/EXaml/Block/GatherEventsBlock.cs
new file mode 100755 (executable)
index 0000000..2eeff08
--- /dev/null
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherEventsBlock : Action
+    {
+        public GatherEventsBlock(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '>':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            int typeIndex = int.Parse(childOp.ValueList[0] as string);
+            string eventName = childOp.ValueList[1] as string;
+
+            LoadEXaml.Operations.Add(new GatherEvent(typeIndex, eventName));
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Block/GatherMethodsBlock.cs b/src/Tizen.NUI/src/internal/EXaml/Block/GatherMethodsBlock.cs
new file mode 100755 (executable)
index 0000000..6a9a02c
--- /dev/null
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherMethodsBlock : Action
+    {
+        public GatherMethodsBlock(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '>':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            int typeIndex = int.Parse(childOp.ValueList[0] as string);
+            string name = childOp.ValueList[1] as string;
+            LoadEXaml.Operations.Add(new GatherMethod(typeIndex, name));
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Block/GatherPropertiesBlock.cs b/src/Tizen.NUI/src/internal/EXaml/Block/GatherPropertiesBlock.cs
new file mode 100755 (executable)
index 0000000..25a1436
--- /dev/null
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherPropertiesBlock : Action
+    {
+        public GatherPropertiesBlock(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '>':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            int typeIndex = int.Parse(childOp.ValueList[0] as string);
+            string propertyName = childOp.ValueList[1] as string;
+
+            LoadEXaml.Operations.Add(new GatherProperty(typeIndex, propertyName));
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Block/GatherTypesBlock.cs b/src/Tizen.NUI/src/internal/EXaml/Block/GatherTypesBlock.cs
new file mode 100755 (executable)
index 0000000..76c18ca
--- /dev/null
@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherTypesBlock : Action
+    {
+        public GatherTypesBlock(Action parent)
+        {
+            this.parent = parent;
+        }
+
+        private Action parent;
+
+        public Action DealChar(char c)
+        {
+            switch (c)
+            {
+                case ' ':
+                case '\n':
+                case '\r':
+                    break;
+
+                case '(':
+                    childOp = new GetValueListAction(')', this);
+                    return childOp;
+
+                case '>':
+                    parent?.OnActive();
+                    return parent;
+            }
+
+            return this;
+        }
+
+        private GetValueListAction childOp;
+
+        public void Init()
+        {
+            childOp = null;
+        }
+
+        public void OnActive()
+        {
+            LoadEXaml.Operations.Add(GatherType(childOp.ValueList));
+            childOp = null;
+        }
+
+        private GatherType GatherType(List<object> valueList)
+        {
+            int assemblyIndex = int.Parse(valueList[0] as string);
+            string typeName = valueList[valueList.Count - 1] as string;
+
+            if (valueList.Count > 2)
+            {
+                List<int> genericTypeIndexs = new List<int>();
+                var genericTypeIndexList = valueList[1] as List<object>;
+                foreach (var index in genericTypeIndexList)
+                {
+                    genericTypeIndexs.Add((int)index);
+                }
+
+                return new GatherType(assemblyIndex, typeName, genericTypeIndexs);
+            }
+            else
+            {
+                return new GatherType(assemblyIndex, typeName);
+            }
+        }
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/LoadEXaml.cs b/src/Tizen.NUI/src/internal/EXaml/LoadEXaml.cs
new file mode 100755 (executable)
index 0000000..a074ed8
--- /dev/null
@@ -0,0 +1,147 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+
+namespace Tizen.NUI.EXaml
+{
+    internal static class LoadEXaml
+    {
+        internal static void Load(object view, string xaml)
+        {
+            CreateObjectAction.Root = view;
+
+            int index = 0;
+
+            var createObject = new CreateObjectAction(null);
+            var addExistInstance = new AddExistInstanceAction(null);
+            var registerXName = new RegisterXNameAction(null);
+            var setProperty = new SetPropertyAction(null);
+            var addEvent = new AddEventAction(null);
+            var setBindalbeProperty = new SetBindalbePropertyAction(null);
+            var addObject = new CallAddMethodAction(null);
+            var setDynamicResourceAction = new SetDynamicResourceAction(null);
+            var addToResourceDictionaryAction = new AddToResourceDictionaryAction(null);
+            var setBindingAction = new SetBindingAction(null);
+
+            foreach (char c in xaml)
+            {
+                //Console.Write(c);
+                if (null == currentOp)
+                {
+                    switch (c)
+                    {
+                        case '<':
+                            if (0 == index)
+                            {
+                                currentOp = new GatherAssembliesBlock(null);
+                                currentOp.Init();
+                                index++;
+                            }
+                            else if (1 == index)
+                            {
+                                currentOp = new GatherTypesBlock(null);
+                                currentOp.Init();
+                                index++;
+                            }
+                            else if (2 == index)
+                            {
+                                currentOp = new GatherPropertiesBlock(null);
+                                currentOp.Init();
+                                index++;
+                            }
+                            else if (3 == index)
+                            {
+                                currentOp = new GatherEventsBlock(null);
+                                currentOp.Init();
+                                index++;
+                            }
+                            else if (4 == index)
+                            {
+                                currentOp = new GatherMethodsBlock(null);
+                                currentOp.Init();
+                                index++;
+                            }
+                            else if (5 == index)
+                            {
+                                currentOp = new GatherBindablePropertiesAction(null);
+                                currentOp.Init();
+                                index++;
+                            }
+                            break;
+
+                        case '{':
+                            currentOp = createObject;
+                            currentOp.Init();
+                            break;
+
+                        case '@':
+                            currentOp = addExistInstance;
+                            currentOp.Init();
+                            break;
+
+                        case '&':
+                            currentOp = registerXName;
+                            currentOp.Init();
+                            break;
+
+                        case '[':
+                            currentOp = setProperty;
+                            currentOp.Init();
+                            break;
+
+                        case '#':
+                            currentOp = addEvent;
+                            currentOp.Init();
+                            break;
+
+                        case '!':
+                            currentOp = setBindalbeProperty;
+                            currentOp.Init();
+                            break;
+
+                        case '$':
+                            currentOp = setDynamicResourceAction;
+                            currentOp.Init();
+                            break;
+
+                        case '^':
+                            currentOp = addObject;
+                            currentOp.Init();
+                            break;
+
+                        case '*':
+                            currentOp = addToResourceDictionaryAction;
+                            currentOp.Init();
+                            break;
+
+                        case '%':
+                            currentOp = setBindingAction;
+                            currentOp.Init();
+                            break;
+                    }
+                }
+                else
+                {
+                    currentOp = currentOp.DealChar(c);
+                }
+            }
+
+            foreach (var op in Operations)
+            {
+                op.Do();
+            }
+        }
+
+        internal static List<object> GatheredInstances
+        {
+            get;
+        } = new List<object>();
+
+        internal static List<Operation> Operations
+        {
+            get;
+        } = new List<Operation>();
+
+        private static Action currentOp = null;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/AddEvent.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/AddEvent.cs
new file mode 100755 (executable)
index 0000000..fadecf8
--- /dev/null
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class AddEvent : Operation
+    {
+        public AddEvent(int instanceIndex, int elementIndex, int eventIndex, int valueIndex)
+        {
+            this.instanceIndex = instanceIndex;
+            this.elementIndex = elementIndex;
+            this.eventIndex = eventIndex;
+            this.valueIndex = valueIndex;
+        }
+
+        public void Do()
+        {
+            object instance = LoadEXaml.GatheredInstances[instanceIndex];
+            object element = LoadEXaml.GatheredInstances[elementIndex];
+            var eventInfo = GatherEvent.GatheredEvents[eventIndex];
+            try
+            {
+                var methodInfo = GatherMethod.GatheredMethods[valueIndex];
+                eventInfo.AddEventHandler(instance, methodInfo.CreateDelegate(eventInfo.EventHandlerType, element));
+            }
+            catch (ArgumentException ae)
+            {
+                Tizen.Log.Fatal("EXaml", ae.ToString());
+            }
+        }
+
+        private int instanceIndex;
+        private int elementIndex;
+        private int eventIndex;
+        private int valueIndex;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/AddToResourceDictionary.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/AddToResourceDictionary.cs
new file mode 100755 (executable)
index 0000000..2941583
--- /dev/null
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class AddToResourceDictionary : Operation
+    {
+        internal AddToResourceDictionary(int instanceIndex, string key, object value)
+        {
+            this.instanceIndex = instanceIndex;
+            this.key = key;
+            this.value = value;
+        }
+
+        public void Do()
+        {
+            var instance = LoadEXaml.GatheredInstances[instanceIndex] as ResourceDictionary;
+            var realValue = (value is Instance) ? LoadEXaml.GatheredInstances[(value as Instance).Index] : value;
+
+            instance.Add(key, realValue);
+        }
+
+        private int instanceIndex;
+        private string key;
+        private object value;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/CallAddMethod.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/CallAddMethod.cs
new file mode 100755 (executable)
index 0000000..d9f3013
--- /dev/null
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class CallAddMethod : Operation
+    {
+        public CallAddMethod(int parentIndex, int childIndex, int methodIndex)
+        {
+            this.parentIndex = parentIndex;
+            this.childIndex = childIndex;
+            this.methodIndex = methodIndex;
+        }
+
+        public void Do()
+        {
+            object parent = LoadEXaml.GatheredInstances[parentIndex];
+            object child = LoadEXaml.GatheredInstances[childIndex];
+            var method = GatherMethod.GatheredMethods[methodIndex];
+
+            method.Invoke(parent, new object[] { child });
+        }
+
+        private int parentIndex;
+        private int childIndex;
+        private int methodIndex;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/CreateInstance.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/CreateInstance.cs
new file mode 100755 (executable)
index 0000000..55a4718
--- /dev/null
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class CreateInstance : Operation
+    {
+        public CreateInstance(int typeIndex, List<object> paramList = null)
+        {
+            this.typeIndex = typeIndex;
+            this.paramList = paramList;
+        }
+
+        public void Do()
+        {
+            if (0 == LoadEXaml.GatheredInstances.Count && null != Root)
+            {
+                LoadEXaml.GatheredInstances.Add(Root);
+            }
+            else
+            {
+                var type = GatherType.GatheredTypes[typeIndex];
+
+                if (null == paramList)
+                {
+                    LoadEXaml.GatheredInstances.Add(Activator.CreateInstance(type));
+                }
+                else
+                {
+                    for (int i = 0; i < paramList.Count; i++)
+                    {
+                        if (paramList[i] is Instance)
+                        {
+                            paramList[i] = LoadEXaml.GatheredInstances[(paramList[i] as Instance).Index];
+                        }
+                    }
+                    LoadEXaml.GatheredInstances.Add(Activator.CreateInstance(type, paramList.ToArray()));
+                }
+            }
+
+            if (1 == LoadEXaml.GatheredInstances.Count)
+            {
+                var rootObject = LoadEXaml.GatheredInstances[0] as BindableObject;
+                if (null != rootObject)
+                {
+                    rootObject.IsCreateByXaml = true;
+                    NameScope nameScope = new NameScope();
+                    NameScope.SetNameScope(rootObject, nameScope);
+                }
+            }
+        }
+
+        private int typeIndex;
+
+        internal static object Root;
+
+        private List<object> paramList;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/GatherAssembly.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/GatherAssembly.cs
new file mode 100755 (executable)
index 0000000..59e1b87
--- /dev/null
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+using Tizen.NUI.Xaml;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherAssembly : Operation
+    {
+        public GatherAssembly(string assemblyName)
+        {
+            this.assemblyName = assemblyName;
+        }
+
+        public void Do()
+        {
+            Assembly assembly = null;
+            foreach (var name in AssemblyNameList)
+            {
+                if (name.FullName.StartsWith(assemblyName))
+                {
+                    assembly = Assembly.Load(name);
+                    GatheredAssemblies.Add(assembly);
+                    break;
+                }
+            }
+        }
+
+        private static List<AssemblyName> assemblyNameList;
+        private static List<AssemblyName> AssemblyNameList
+        {
+            get
+            {
+                if (null == assemblyNameList)
+                {
+                    assemblyNameList = new List<AssemblyName>();
+                    assemblyNameList.Add(EXamlExtensions.MainAssembly.GetName());
+
+                    var assemblyNames = EXamlExtensions.MainAssembly.GetReferencedAssemblies();
+
+                    foreach (var name in assemblyNames)
+                    {
+                        assemblyNameList.Add(name);
+                    }
+                }
+
+                return assemblyNameList;
+            }
+        }
+
+        private string assemblyName;
+        internal static List<Assembly> GatheredAssemblies = new List<Assembly>();
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/GatherBindableProperties.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/GatherBindableProperties.cs
new file mode 100755 (executable)
index 0000000..28d4b87
--- /dev/null
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherBindableProperties : Operation
+    {
+        public GatherBindableProperties(int typeIndex, string propertyName)
+        {
+            this.typeIndex = typeIndex;
+            this.propertyName = propertyName;
+        }
+
+        public void Do()
+        {
+            var type = GatherType.GatheredTypes[typeIndex];
+            var field = type.GetField(fi => fi.Name == propertyName && fi.IsStatic && fi.IsPublic);
+            if (null == field)
+            {
+                field = type.GetField(fi => fi.Name == propertyName && fi.IsStatic && !fi.IsPublic);
+            }
+
+            GatheredBindableProperties.Add(field.GetValue(null) as BindableProperty);
+        }
+
+        private int typeIndex;
+        private string propertyName;
+        internal static List<BindableProperty> GatheredBindableProperties = new List<BindableProperty>();
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/GatherConvertedValue.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/GatherConvertedValue.cs
new file mode 100755 (executable)
index 0000000..b266179
--- /dev/null
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherConvertedValue : Operation
+    {
+        public GatherConvertedValue(int converterIndex, string value)
+        {
+            this.converterIndex = converterIndex;
+            this.value = value;
+        }
+
+        public void Do()
+        {
+            var converter = LoadEXaml.GatheredInstances[converterIndex] as TypeConverter;
+            LoadEXaml.GatheredInstances.Add(converter.ConvertFromInvariantString(value));
+        }
+
+        private int converterIndex;
+        private string value;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/GatherEnumValue.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/GatherEnumValue.cs
new file mode 100755 (executable)
index 0000000..49e4385
--- /dev/null
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherEnumValue : Operation
+    {
+        public GatherEnumValue(int typeIndex, string value)
+        {
+            this.typeIndex = typeIndex;
+            this.value = value;
+        }
+
+        public void Do()
+        {
+            var enumType = GatherType.GatheredTypes[typeIndex];
+            LoadEXaml.GatheredInstances.Add(Enum.Parse(enumType, value));
+        }
+
+        private int typeIndex;
+        private string value;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/GatherEvent.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/GatherEvent.cs
new file mode 100755 (executable)
index 0000000..f56b5f2
--- /dev/null
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherEvent : Operation
+    {
+        public GatherEvent(int typeIndex, string eventName)
+        {
+            this.typeIndex = typeIndex;
+            this.eventName = eventName;
+        }
+
+        public void Do()
+        {
+            var type = GatherType.GatheredTypes[typeIndex];
+            GatheredEvents.Add(type.GetEvent(eventName));
+        }
+
+        private int typeIndex;
+        private string eventName;
+        internal static List<EventInfo> GatheredEvents = new List<EventInfo>();
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/GatherMethod.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/GatherMethod.cs
new file mode 100755 (executable)
index 0000000..2c61214
--- /dev/null
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherMethod : Operation
+    {
+        public GatherMethod(int typeIndex, string methodName)
+        {
+            this.typeIndex = typeIndex;
+            this.methodName = methodName;
+        }
+
+        public void Do()
+        {
+            var type = GatherType.GatheredTypes[typeIndex];
+            var method = type.GetRuntimeMethods().FirstOrDefault(mi => mi.Name == methodName);
+            GatheredMethods.Add(method);
+        }
+
+        private int typeIndex;
+        private string methodName;
+        internal static List<MethodInfo> GatheredMethods = new List<MethodInfo>();
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/GatherProperty.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/GatherProperty.cs
new file mode 100755 (executable)
index 0000000..d32e9e2
--- /dev/null
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherProperty : Operation
+    {
+        public GatherProperty(int typeIndex, string propertyName)
+        {
+            this.typeIndex = typeIndex;
+            this.propertyName = propertyName;
+        }
+
+        public void Do()
+        {
+            var type = GatherType.GatheredTypes[typeIndex];
+            GatheredProperties.Add(type.GetProperty(propertyName));
+        }
+
+        private int typeIndex;
+        private string propertyName;
+        internal static List<PropertyInfo> GatheredProperties = new List<PropertyInfo>();
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/GatherType.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/GatherType.cs
new file mode 100755 (executable)
index 0000000..5b56a08
--- /dev/null
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class GatherType : Operation
+    {
+        public GatherType(int assemblyIndex, string typeName, List<int> genericTypeIndexs = null)
+        {
+            this.assemblyIndex = assemblyIndex;
+            this.typeName = typeName;
+            this.genericTypeIndexs = genericTypeIndexs;
+        }
+
+        public void Do()
+        {
+            var assembly = GatherAssembly.GatheredAssemblies[assemblyIndex];
+            var type = assembly.GetType(typeName);
+
+            if (null != genericTypeIndexs)
+            {
+                Type[] args = new Type[genericTypeIndexs.Count];
+
+                for (int i = 0; i < genericTypeIndexs.Count; i++)
+                {
+                    args[i] = GatheredTypes[genericTypeIndexs[i]];
+                }
+
+                type = type.MakeGenericType(args);
+            }
+
+            GatheredTypes.Add(type);
+        }
+
+        private int assemblyIndex;
+        private string typeName;
+        private List<int> genericTypeIndexs;
+
+        internal static List<Type> GatheredTypes = new List<Type>();
+    }
+
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/Operation.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/Operation.cs
new file mode 100755 (executable)
index 0000000..bb6e8db
--- /dev/null
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal interface Operation
+    {
+        void Do();
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/RegisterXName.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/RegisterXName.cs
new file mode 100755 (executable)
index 0000000..2b3a53e
--- /dev/null
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class RegisterXName : Operation
+    {
+        public RegisterXName(object instance, string name)
+        {
+            this.instance = instance;
+            this.name = name;
+        }
+
+        public void Do()
+        {
+            object realInstance = null;
+            if (instance is Instance)
+            {
+                realInstance = LoadEXaml.GatheredInstances[(instance as Instance).Index];
+            }
+            else
+            {
+                realInstance = instance;
+            }
+
+            var namescope = NameScope.GetNameScope(CreateInstance.Root as BindableObject);
+            namescope?.RegisterName(name, realInstance);
+        }
+
+        private object instance;
+        private string name;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/SetBindalbeProperty.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/SetBindalbeProperty.cs
new file mode 100755 (executable)
index 0000000..52badb0
--- /dev/null
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class SetBindalbeProperty : Operation
+    {
+        public SetBindalbeProperty(int instanceIndex, int bindalbePropertyIndex, object value)
+        {
+            this.instanceIndex = instanceIndex;
+            this.bindalbePropertyIndex = bindalbePropertyIndex;
+            this.value = value;
+        }
+
+        public void Do()
+        {
+            var instance = LoadEXaml.GatheredInstances[instanceIndex] as BindableObject;
+
+            if (null != instance)
+            {
+                var property = GatherBindableProperties.GatheredBindableProperties[bindalbePropertyIndex];
+
+                if (value is Instance)
+                {
+                    int valueIndex = (value as Instance).Index;
+                    instance.SetValue(property, LoadEXaml.GatheredInstances[valueIndex]);
+                }
+                else
+                {
+                    instance.SetValue(property, value);
+                }
+            }
+        }
+
+        private int instanceIndex;
+        private int bindalbePropertyIndex;
+        private object value;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/SetBinding.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/SetBinding.cs
new file mode 100755 (executable)
index 0000000..17cacca
--- /dev/null
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class SetBinding : Operation
+    {
+        public SetBinding(int instanceIndex, int bindablePropertyIndex, int valueIndex)
+        {
+            this.instanceIndex = instanceIndex;
+            this.bindablePropertyIndex = bindablePropertyIndex;
+            this.valueIndex = valueIndex;
+        }
+
+        public void Do()
+        {
+            BindableObject bindableObject = LoadEXaml.GatheredInstances[instanceIndex] as BindableObject;
+            var property = GatherBindableProperties.GatheredBindableProperties[bindablePropertyIndex];
+            var value = LoadEXaml.GatheredInstances[valueIndex] as BindingBase;
+            bindableObject?.SetBinding(property, value);
+        }
+
+        private int instanceIndex;
+        private int bindablePropertyIndex;
+        private int valueIndex;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/SetDynamicResource.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/SetDynamicResource.cs
new file mode 100755 (executable)
index 0000000..784c88f
--- /dev/null
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class SetDynamicResource : Operation
+    {
+        public SetDynamicResource(int instanceIndex, int propertyIndex, string key)
+        {
+            this.instanceIndex = instanceIndex;
+            this.propertyIndex = propertyIndex;
+            this.key = key;
+        }
+
+        public void Do()
+        {
+            var instance = LoadEXaml.GatheredInstances[instanceIndex] as BindableObject;
+            var property = GatherBindableProperties.GatheredBindableProperties[propertyIndex];
+
+            instance.SetDynamicResource(property, key);
+        }
+
+        private int instanceIndex;
+        private int propertyIndex;
+        private string key;
+    }
+}
diff --git a/src/Tizen.NUI/src/internal/EXaml/Operation/SetProperty.cs b/src/Tizen.NUI/src/internal/EXaml/Operation/SetProperty.cs
new file mode 100755 (executable)
index 0000000..b746baa
--- /dev/null
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Binding;
+using Tizen.NUI.Binding.Internals;
+
+namespace Tizen.NUI.EXaml
+{
+    internal class SetProperty : Operation
+    {
+        public SetProperty(int instanceIndex, int propertyIndex, object value)
+        {
+            this.instanceIndex = instanceIndex;
+            this.propertyIndex = propertyIndex;
+            this.value = value;
+        }
+
+        public void Do()
+        {
+            object instance = LoadEXaml.GatheredInstances[instanceIndex];
+            var property = GatherProperty.GatheredProperties[propertyIndex];
+
+            if (value is Instance)
+            {
+                int valueIndex = (value as Instance).Index;
+                property.SetMethod.Invoke(instance, new object[] { LoadEXaml.GatheredInstances[valueIndex] });
+            }
+            else
+            {
+                property.SetMethod.Invoke(instance, new object[] { value });
+            }
+        }
+
+        private int instanceIndex;
+        private int propertyIndex;
+        private object value;
+    }
+}
diff --git a/src/Tizen.NUI/src/public/EXaml/EXamlExtensions.cs b/src/Tizen.NUI/src/public/EXaml/EXamlExtensions.cs
new file mode 100755 (executable)
index 0000000..3ded9fc
--- /dev/null
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Reflection;
+using System.Text;
+
+namespace Tizen.NUI.EXaml
+{
+    /// Internal used, will never be opened.
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public static class EXamlExtensions
+    {
+        /// Internal used, will never be opened.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static TXaml LoadFromEXamlPath<TXaml>(this TXaml view, string path)
+        {
+            //This EXaml file will be converted by Tizen.NUI.XamlBuild from the .xaml
+            string xamlScript = GetXamlFromPath(path);
+            LoadEXaml.Load(view, xamlScript);
+            return view;
+        }
+
+        /// Internal used, will never be opened.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static TXaml LoadFromEXamlPath<TXaml>(this TXaml view, Type callingType)
+        {
+            if (null == callingType)
+            {
+                return view;
+            }
+
+            MainAssembly = view.GetType().Assembly;
+
+            string resourceName = callingType.Name + ".examl";
+            string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
+
+            Tizen.Log.Fatal("NUI", "the resource path: " + resource);
+            int windowWidth = NUIApplication.GetDefaultWindow().Size.Width;
+            int windowHeight = NUIApplication.GetDefaultWindow().Size.Height;
+
+            string likelyResourcePath = resource + "layout/" + windowWidth.ToString() + "x" + windowHeight.ToString() + "/" + resourceName;
+            Tizen.Log.Fatal("NUI", "the resource path: " + likelyResourcePath);
+
+            if (!File.Exists(likelyResourcePath))
+            {
+                likelyResourcePath = resource + "layout/" + resourceName;
+            }
+
+            //Find the xaml file in the layout folder
+            if (File.Exists(likelyResourcePath))
+            {
+                StreamReader reader = new StreamReader(likelyResourcePath);
+                var xaml = reader.ReadToEnd();
+                reader.Close();
+                reader.Dispose();
+
+                LoadEXaml.Load(view, xaml);
+            }
+                
+            return view;
+        }
+
+        /// Internal used, will never be opened.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public static Assembly MainAssembly
+        {
+            get;
+            set;
+        }
+
+        private static string GetXamlFromPath(string path)
+        {
+            string xaml;
+
+            if (File.Exists(path))
+            {
+                StreamReader reader = new StreamReader(path);
+                xaml = reader.ReadToEnd();
+                reader.Dispose();
+                return xaml;
+            }
+            return null;
+        }
+    }
+}