Where should I add FluentDialogProvider when the project was created using the fluent blazor project templat? #2884
-
As per the document, I should add these: <FluentDialogProvider /> to the end of the However the MainLayout.razor created by the template looks like below: @inherits LayoutComponentBase
<FluentLayout>
<FluentHeader>
WarrantyApp
</FluentHeader>
<FluentStack Class="main" Orientation="Orientation.Horizontal" Width="100%">
<NavMenu />
<FluentBodyContent Class="body-content">
<div class="content">
@Body
</div>
</FluentBodyContent>
</FluentStack>
<FluentFooter>
<a href="https://www.fluentui-blazor.net" target="_blank">Documentation and demos</a>
<FluentSpacer />
<a href="https://learn.microsoft.com/en-us/aspnet/core/blazor" target="_blank">About Blazor</a>
</FluentFooter>
</FluentLayout>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div> Where's |
Beta Was this translation helpful? Give feedback.
Answered by
NabaviFard-Mahdi
Nov 2, 2024
Replies: 2 comments 2 replies
-
Best place to put this (and other providers) is probably at the end of the FluentBodyContent |
Beta Was this translation helpful? Give feedback.
2 replies
-
In blazor SSR - interactivity per page/component you can do this in MainLayout.razor <FluentDialogProvider @rendermode="InteractiveServer"/> Sample : @using PishranWebApp.Shared.Resources
@using Microsoft.FluentUI.AspNetCore.Components.DesignTokens
@inject Direction DirectionDesignToken
@inherits LayoutComponentBase
<FluentToastProvider MaxToastCount="50" Timeout="5000" Position="ToastPosition.TopCenter" @rendermode="InteractiveServer"/>
<FluentDialogProvider @rendermode="InteractiveServer"/>
<FluentTooltipProvider @rendermode="InteractiveServer"/>
<FluentMessageBarProvider Section="Main" @rendermode="InteractiveServer"/>
<FluentMenuProvider/>
<FluentLayout>
<FluentHeader>
<FluentStack Orientation="Orientation.Horizontal" HorizontalAlignment="HorizontalAlignment.Center" VerticalAlignment="VerticalAlignment.Center">
<FluentStack Orientation="Orientation.Vertical" HorizontalAlignment="HorizontalAlignment.Start" VerticalAlignment="VerticalAlignment.Center">
<AppTheme/>
</FluentStack>
<FluentStack Orientation="Orientation.Vertical" HorizontalAlignment="HorizontalAlignment.End" VerticalAlignment="VerticalAlignment.Center">
<FluentProfileMenu
Status="@PresenceStatus.Available"
HeaderLabel="@AppStringResource.AppCompanyName"
Initials="YSB"
FullName="Bill Gates"
EMail="[email protected]"
PopoverStyle="min-width: 330px;"
ImageSize="32px"
TopCorner="true"
FooterLabel="@AppStringResource.Account"
FooterLink="/Account/Profile"
HeaderButton="@AppStringResource.SignOut"/>
</FluentStack>
</FluentStack>
</FluentHeader>
<FluentStack Class="main" Orientation="Orientation.Horizontal" Width="100%">
<NavMenu/>
<FluentBodyContent Class="body-content">
<div class="content">
@Body
</div>
</FluentBodyContent>
</FluentStack>
<FluentFooter>
<a href="https://www.fluentui-blazor.net" target="_blank">Documentation and demos</a>
<FluentSpacer/>
<a href="https://learn.microsoft.com/en-us/aspnet/core/blazor" target="_blank">About Blazor</a>
</FluentFooter>
</FluentLayout>
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
LITTOMA
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In blazor SSR - interactivity per page/component you can do this in MainLayout.razor
Sample :