using Noesis;

namespace Testing
{
    public class InputActionGlyph : UserControl
    {
        public InputActionGlyph()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {
            NoesisUnity.LoadComponent(this);

            Loaded += (s, e) =>
            {
                InputActionGlyph control = (InputActionGlyph)s;
                control.OnLoaded(s, e);
            };
        }

        public static readonly DependencyProperty ActionProperty = DependencyProperty.Register(
            "Action", typeof(string), typeof(InputActionGlyph));

        public void OnLoaded(object sender, EventArgs args)
        {
            var a = (string)GetValue(ActionProperty); // The value of a is empty string
            UnityEngine.Debug.Log($"InputActionGlyph.Action = {a}");
        }
    }
}