Пример #1
0
        public static FWButtonControl CreateRemoveButton()
        {
            FWButtonControl button = new FWButtonControl()
                                     .Behavior(FWButtonBehavior.Exclude);

            button.AddCssClass("btn-detail");
            return(button);
        }
Пример #2
0
        public static FWButtonControl CreateAddButton()
        {
            FWButtonControl button = new FWButtonControl()
                                     .Icon("fa fa-plus")
                                     .Behavior(FWButtonBehavior.Add);

            button.Title = ViewResources.Btn_Add;
            button.AddCssClass("btn-add");
            return(button);
        }
Пример #3
0
        public static FWButtonControl CreateUndoButton()
        {
            FWButtonControl button = new FWButtonControl()
                                     .Icon("fa fa-undo")
                                     .Behavior("Undo");

            button.Text = ViewResources.Btn_UndoRemoved;
            button.Size(FWElementSize.Small);
            button.Title = ViewResources.Btn_UndoRemoved;
            button.Attributes.Add("style", "display:none");
            return(button);
        }
Пример #4
0
        /// <summary>
        /// Creates the framework control.
        /// </summary>
        /// <param name="context">Contains information associated with the current HTML tag.</param>
        /// <param name="output">A stateful HTML element used to generate an HTML tag.</param>
        /// <returns>The control instance.</returns>
        protected override IFWHtmlElement RenderControl(TagHelperContext context, TagHelperOutput output)
        {
            var control = new FWButtonControl(Id);

            if ((!ChildContent.IsEmptyOrWhiteSpace))
            {
                control.Text = ChildContent.GetContent();
            }

            control.ButtonType(ResolveButtonType());
            control.Size(Size);

            if (Url != null)
            {
                control.Url(Url);
            }

            if (Behavior.HasValue)
            {
                control.Behavior(Behavior.Value);
            }

            if (ConfirmTitle != null && ConfirmMessage != null)
            {
                control.Confirm(ConfirmTitle, ConfirmMessage);
            }

            if (Color.HasValue)
            {
                control.Color(Color.Value);
            }

            if (Icon != null)
            {
                control.Icon(Icon);
            }

            control.Attributes.Add("data-control", "button");

            if (context.Items.ContainsKey("btngroup"))
            {
                var group = context.Items["btngroup"] as FWButtonGroupControl;
                group.AddButton(control);
            }

            return(control);
        }
Пример #5
0
        private void AddInputLayout(FWDivElement body)
        {
            body.AddCssClass("upload");
            body.Attributes.Add("data-theme", "input");

            body.Add($"<div data-type=\"upload-template\" data-toggle=\"popover\" class=\"dz-preview\"><img data-dz-thumbnail style=\"display:none\" /><span data-dz-name></span><span data-dz-progress></span><span data-type=\"Remove\" class=\"m--font-danger\" title=\"{ViewResources.Btn_Upload_Remove}\"><i class=\"fas fa-ban\"></i></span></div>");

            body.Add("<div data-type=\"upload-preview\" class=\"upload-preview\"></div>");

            var button = new FWButtonControl($"{Id}_btn_upload")
            {
                Text     = _maxFiles == 1 ? ViewResources.Btn_Upload : ViewResources.Btn_Upload_Multiple,
                DataType = "upload-clickable"
            };

            button.Icon("fas fa-upload");
            button.Size(FWElementSize.Small);
            body.Add(button.ToString());
        }