Exemplo n.º 1
0
        public QuickCheckbox Checkbox(Expression <Func <bool> > memberAccessExpr, string name = null)
        {
            var memberInfo = ReflectHelper.AnalyzeMember(memberAccessExpr);
            var label      = ReflectHelper.GetLabelInfo(memberInfo.TopmostMember);
            var desc       = ReflectHelper.GetDescriptionInfo(memberInfo.TopmostMember);
            var checkbox   = new QuickCheckbox(parent: CurrentParent, name: name ?? memberInfo.TopmostMember.Name)
            {
                Label   = label,
                Tooltip = desc,
            };

            checkbox.IsChecked.Bind(memberAccessExpr);
            return(checkbox);
        }
Exemplo n.º 2
0
        public QuickDropdown <T> Dropdown <T>(Expression <Func <T> > memberAccessExpr, IEnumerable <DropdownChoice <T> > choices, string name = null)
        {
            var memberInfo = ReflectHelper.AnalyzeMember(memberAccessExpr);
            var label      = ReflectHelper.GetLabelInfo(memberInfo.TopmostMember);
            var desc       = ReflectHelper.GetDescriptionInfo(memberInfo.TopmostMember);
            var dropdown   = new QuickDropdown <T>(CurrentParent, name: name ?? memberInfo.TopmostMember.Name)
            {
                Options     = choices.ToArray(),
                LabelText   = label,
                TooltipText = desc,
            };

            dropdown.SelectedValue.Bind(memberAccessExpr);
            return(dropdown);
        }