Skip to content

Commit 09e3633

Browse files
authored
Fix #4214 (#4219)
1 parent ea1e8a0 commit 09e3633

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

examples/Demo/Shared/Microsoft.FluentUI.AspNetCore.Components.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6697,6 +6697,13 @@
66976697
Gets or sets a reference to the menu.
66986698
</summary>
66996699
</member>
6700+
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentMenuButton.UseMenuService">
6701+
<summary>
6702+
Use IMenuService to create the menu, if this service was injected.
6703+
This value must be defined before the component is rendered (you can't change it during the component lifecycle).
6704+
Default, true.
6705+
</summary>
6706+
</member>
67006707
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentMenuButton.Text">
67016708
<summary>
67026709
Gets or sets the texts shown on th button.

src/Core/Components/MenuButton/FluentMenuButton.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<FluentIcon Value="@(new CoreIcons.Regular.Size12.ChevronDown())" Slot="end" Color="@_iconColor" />
99
</FluentButton>
1010
<FluentOverlay @bind-Visible="@_visible" Transparent="true" FullScreen="true" />
11-
<FluentMenu @ref="Menu" Anchor="@_buttonId" aria-labelledby="button" Style="@MenuStyleValue" @bind-Open=@_visible @onmenuchange=OnMenuChangeAsync>
11+
<FluentMenu @ref="Menu" Anchor="@_buttonId" aria-labelledby="button" Style="@MenuStyleValue" @bind-Open=@_visible @onmenuchange=OnMenuChangeAsync UseMenuService="@UseMenuService">
1212
@foreach (KeyValuePair<string, string> item in Items)
1313
{
1414
<FluentMenuItem Id="@item.Key">@item.Value</FluentMenuItem>

src/Core/Components/MenuButton/FluentMenuButton.razor.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ public partial class FluentMenuButton : FluentComponentBase
3636
[Parameter]
3737
public FluentMenu? Menu { get; set; }
3838

39+
/// <summary>
40+
/// Use IMenuService to create the menu, if this service was injected.
41+
/// This value must be defined before the component is rendered (you can't change it during the component lifecycle).
42+
/// Default, true.
43+
/// </summary>
44+
[Parameter]
45+
public bool UseMenuService { get; set; } = true;
46+
3947
/// <summary>
4048
/// Gets or sets the texts shown on th button.
4149
/// </summary>

0 commit comments

Comments
 (0)