public static PageToolbar AddButton( this PageToolbar toolbar, string text, Func <Task> clicked, object icon = null, Color color = Color.Primary, bool disabled = false, int order = 0, string requiredPolicyName = null) { toolbar.AddComponent <ToolbarButton>( new Dictionary <string, object> { { nameof(ToolbarButton.Color), color }, { nameof(ToolbarButton.Text), text }, { nameof(ToolbarButton.Disabled), disabled }, { nameof(ToolbarButton.Icon), icon }, { nameof(ToolbarButton.Clicked), clicked }, }, order, requiredPolicyName ); return(toolbar); }
public static PageToolbar AddComponent <TComponent>( this PageToolbar toolbar, Dictionary <string, object> arguments = null, int order = 0, string requiredPolicyName = null) { return(toolbar.AddComponent( typeof(TComponent), arguments, order, requiredPolicyName )); }
public static PageToolbar AddButton( this PageToolbar toolbar, ILocalizableString text, string icon = null, string name = null, string id = null, ILocalizableString busyText = null, FontIconType iconType = FontIconType.FontAwesome, AbpButtonType type = AbpButtonType.Primary, AbpButtonSize size = AbpButtonSize.Small, bool disabled = false, int order = 0, string requiredPolicyName = null) { if (busyText == null) { busyText = new LocalizableString(typeof(AbpUiResource), "ProcessingWithThreeDot"); } toolbar.AddComponent <AbpPageToolbarButtonViewComponent>( new { text, icon, name, id, busyText, iconType, type, size, disabled }, order, requiredPolicyName ); return(toolbar); }