Example #1
0
        public static void AddUiProperties()
        {
            ApplicationBase.UI.Controls.AddKeySingle(
                new UiElement <object>
            {
                Key     = "MyParameters1",
                Context = { new BindingProperty <object>("IsChecked", true) }
            });

            Button b = new Button
            {
                Uid       = "MyButtonUid",
                Name      = "MyButtonName",
                IsEnabled = false
            };

            ApplicationBase.UI.Controls.AddKeySingle(new UiElement <object>(b, "IsEnabled", false));

            // Adding of a new property to store
            UiElement <object> btn = ApplicationBase.UI.Controls.FindControl(b);

            btn.Context.Add(new BindingProperty <object> {
                Name = "Content", Value = "Enter"
            });

            b.Content   = btn.FindBindingProperty("Content").Value;
            b.IsEnabled = (bool)btn.FindBindingProperty("IsEnabled").Value;

            var test = b;
        }