@@ -29,6 +29,14 @@ public partial class FluentMenuButton : FluentComponentBase
2929 [ Parameter ]
3030 public Appearance ButtonAppearance { get ; set ; } = Appearance . Accent ;
3131
32+ /// <summary>
33+ /// The content to be rendered inside the button. This parameter should be supplied if you do not want to render a chevron
34+ /// on the menu button.
35+ /// If both <see cref="Text"/> and ButtonContent are provided, ButtonContent will be used.
36+ /// </summary>
37+ [ Parameter ]
38+ public RenderFragment ? ButtonContent { get ; set ; }
39+
3240 /// <summary>
3341 /// Gets or sets a reference to the menu.
3442 /// </summary>
@@ -44,7 +52,8 @@ public partial class FluentMenuButton : FluentComponentBase
4452 public bool UseMenuService { get ; set ; } = true ;
4553
4654 /// <summary>
47- /// Gets or sets the texts shown on the button. This property will be ignored if <see cref="ButtonContent"/> is provided.
55+ /// Gets or sets the texts shown on the button.
56+ /// If both Text and<see cref = "ButtonContent" /> are provided, ButtonContent will be used.
4857 /// </summary>
4958 [ Parameter ]
5059 public string ? Text { get ; set ; }
@@ -87,25 +96,13 @@ public partial class FluentMenuButton : FluentComponentBase
8796 [ Parameter ]
8897 public EventCallback < MenuChangeEventArgs > OnMenuChanged { get ; set ; }
8998
90- /// <summary>
91- /// The content to be rendered inside the button. This parameter should be supplied if you do not want to render a chevron
92- /// on the menu button. Only one of <see cref="Text"/> or <see cref="ButtonContent"/> may be provided.
93- /// </summary>
94- [ Parameter ]
95- public RenderFragment ? ButtonContent { get ; set ; }
96-
9799 protected override void OnInitialized ( )
98100 {
99101 _buttonId = Identifier . NewId ( ) ;
100102 }
101103
102104 protected override void OnParametersSet ( )
103105 {
104- if ( Text is not null && ButtonContent is not null )
105- {
106- throw new ArgumentException ( $ "Only one of the parameters { nameof ( Text ) } or { nameof ( ButtonContent ) } can be provided.") ;
107- }
108-
109106 _iconColor = ButtonAppearance == Appearance . Accent ? Color . Fill : Color . FillInverse ;
110107 }
111108
0 commit comments