[NUI] Add XNames for Element
authorXianbing Teng <xb.teng@samsung.com>
Tue, 7 Dec 2021 09:15:41 +0000 (17:15 +0800)
committerSeoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com>
Tue, 14 Dec 2021 09:04:07 +0000 (18:04 +0900)
src/Tizen.NUI/src/public/XamlBinding/Element.cs
src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs

index ea7c48a..21271a4 100755 (executable)
@@ -222,6 +222,12 @@ namespace Tizen.NUI.Binding
             }
         }
 
+        /// <summary>
+        /// Gets the x:Name dictionary of the element.
+        /// </summary>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Dictionary<string, object> XNames => (GetNameScope() as NameScope)?.XNames ?? null;
+
         void IElement.RemoveResourcesChangedListener(Action<object, ResourcesChangedEventArgs> onchanged)
         {
             if (changeHandlers == null)
index 62cfa26..1823b75 100755 (executable)
@@ -85,5 +85,8 @@ namespace Tizen.NUI.Binding.Internals
             }
             bindable.SetValue(NameScopeProperty, value);
         }
+
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Dictionary<string, object> XNames => names;
     }
 }