Skip to content

Commit

Permalink
[NUI] Add XNames for Element
Browse files Browse the repository at this point in the history
  • Loading branch information
elishateng authored and Seoyeon2Kim committed Dec 14, 2021
1 parent e9d1d7c commit 736b838
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Tizen.NUI/src/public/XamlBinding/Element.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ public Element Parent
}
}

/// <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)
Expand Down
3 changes: 3 additions & 0 deletions src/Tizen.NUI/src/public/XamlBinding/Internals/NameScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,8 @@ public static void SetNameScope(BindableObject bindable, INameScope value)
}
bindable.SetValue(NameScopeProperty, value);
}

[EditorBrowsable(EditorBrowsableState.Never)]
public Dictionary<string, object> XNames => names;
}
}

0 comments on commit 736b838

Please sign in to comment.