Example #1
0
        protected override void OnInit()
        {
            var classes = ClassNamesBuilder.From(this.PrefixCls,
                                                 new[] { BUTTON_GROUP_CLASS },
                                                 new Dictionary <string, Func <bool> >
            {
                { $"{BUTTON_GROUP_CLASS}-{this.GetSizeClass()}", () => this.Size != ButtonSize.Default },
            });

            this.ClassString = string.IsNullOrWhiteSpace(this.ClassName) ? classes : $"{this.ClassName} {classes}";
        }
Example #2
0
        protected override void OnInit()
        {
            var classes = ClassNamesBuilder.From(this.PrefixCls,
                                                 new[] { DIVIDER_CLASS, this.GetTypeClass() },
                                                 new Dictionary <string, Func <bool> >
            {
                { $"{DIVIDER_CLASS}-with-text{this.GetOrientationClass()}", () => this.ChildContent != null },
                { $"{DIVIDER_CLASS}-dashed", () => this.Dashed }
            });

            this.ClassString = string.IsNullOrWhiteSpace(this.ClassName) ? classes : $"{this.ClassName} {classes}";
        }
Example #3
0
        private void RefreshClasses()
        {
            var classes = ClassNamesBuilder.From(null,
                                                 new[] { ICON_CLASS },
                                                 new Dictionary <string, Func <bool> >
            {
                { $"{ICON_CLASS}-spin", () => this.Spin || this.Type == "loading" },
                { $"{ICON_CLASS}-{this.Type}", () => true }
            });

            this.ClassString = string.IsNullOrWhiteSpace(this.ClassName) ? classes : $"{this.ClassName} {classes}";
        }
Example #4
0
        private void RefreshClasses()
        {
            var classes = ClassNamesBuilder.From(this.PrefixCls,
                                                 new[] { BUTTON_CLASS, $"{BUTTON_CLASS}-{this.GetTypeClass()}" },
                                                 new Dictionary <string, Func <bool> >
            {
                { $"{BUTTON_CLASS}-{this.GetShapeClass()}", () => this.Shape != ButtonShape.Undefined },
                { $"{BUTTON_CLASS}-{this.GetSizeClass()}", () => this.Size != ButtonSize.Default },
                { $"{BUTTON_CLASS}-icon-only", () => this.ChildContent == null && !string.IsNullOrWhiteSpace(this.Icon) },
                { $"{BUTTON_CLASS}-loading", () => this.Loading },
                { $"{BUTTON_CLASS}-clicked", () => this.Clicked },
                { $"{BUTTON_CLASS}-background-ghost", () => this.Ghost }
            });

            this.IconType = this.Loading && string.IsNullOrWhiteSpace(this.Icon) ? "loading" : this.Icon;

            this.ClassString = string.IsNullOrWhiteSpace(this.ClassName) ? classes : $"{this.ClassName} {classes}";
        }