using System.Collections.Generic; using System.ComponentModel; using Tizen.NUI.Binding.Internals; namespace Tizen.NUI.Binding { /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static class NameScopeExtensions { /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static T FindByName(this Element element, string name) { return ((INameScope)element).FindByName(name); } internal static T FindByName(this INameScope namescope, string name) { return (T)namescope?.FindByName(name); } private static Stack elementStack = new Stack(); internal static void PushElement(object element) { elementStack.Push((Element)element); } internal static void PopElement() { elementStack.Pop(); } /// /// Used to find the object defined in Xaml file. /// /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static T FindByNameInCurrentNameScope(string name) { return FindByName(elementStack.Peek(), name); } } }