|
| 1 | +@page "/Layout/Debug" |
| 2 | +@using Microsoft.AspNetCore.Components.Rendering |
| 3 | + |
| 4 | +<h1>Layout Debug Page</h1> |
| 5 | + |
| 6 | +<div style="margin: 24px;"> |
| 7 | + |
| 8 | + @_renderOptions |
| 9 | + |
| 10 | + <FluentTextArea @bind-Value="@HamburgerContent" Label="Hamburger content" /> |
| 11 | + |
| 12 | + <FluentStack Margin="@Margin.Vertical2"> |
| 13 | + View: @(MobileView ? "📱 Mobile" : "💻 Desktop") |
| 14 | + <FluentSpacer /> |
| 15 | + Opened: @Opened |
| 16 | + </FluentStack> |
| 17 | + |
| 18 | + <div style="resize: horizontal; overflow: hidden;"> |
| 19 | + <FluentLayout GlobalScrollbar="@GlobalScrollbar" Height="400px" Style="@CommonStyles.NeutralBorder1" OnBreakpointEnter="@(e => MobileView = e)" MenuDeferredLoading="@MenuDeferredLoading"> |
| 20 | + |
| 21 | + @if (Header.Visible) |
| 22 | + { |
| 23 | + <!-- Header --> |
| 24 | + <FluentLayoutItem Area="@LayoutArea.Header" Sticky="@Header.Sticky"> |
| 25 | + |
| 26 | + <!-- Hamburger menu --> |
| 27 | + <FluentLayoutHamburger OnOpened="@(e => Opened = e.Opened)" |
| 28 | + ChildContent="@(string.IsNullOrWhiteSpace(HamburgerContent) ? null : builder => { builder.AddMarkupContent(0, HamburgerContent); })" /> |
| 29 | + |
| 30 | + <FluentText Weight="TextWeight.Bold" Size="TextSize.Size400"> |
| 31 | + Microsoft Demo |
| 32 | + </FluentText> |
| 33 | + <FluentSpacer /> |
| 34 | + <FluentButton Appearance="ButtonAppearance.Primary" Shape="ButtonShape.Rounded"> |
| 35 | + Sign in |
| 36 | + </FluentButton> |
| 37 | + |
| 38 | + <!-- Second Hamburger menu --> |
| 39 | + <FluentLayoutHamburger OnOpened="@(e => Opened = e.Opened)" |
| 40 | + ChildContent="@(string.IsNullOrWhiteSpace(HamburgerContent) ? null : builder => { builder.AddMarkupContent(0, HamburgerContent); })" /> |
| 41 | + |
| 42 | + </FluentLayoutItem> |
| 43 | + } |
| 44 | + |
| 45 | + @if (Menu.Visible) |
| 46 | + { |
| 47 | + <!-- Menu --> |
| 48 | + <FluentLayoutItem Area="@LayoutArea.Menu" Sticky="@Menu.Sticky" |
| 49 | + Width="150px" Padding="@Padding.All2" |
| 50 | + Style="border-right: var(--strokeWidthThin) solid var(--colorNeutralStroke1);"> |
| 51 | + |
| 52 | + <FluentText Weight="TextWeight.Bold">Navigation</FluentText> |
| 53 | + @NavigationContent |
| 54 | + </FluentLayoutItem> |
| 55 | + } |
| 56 | + |
| 57 | + @if (Content.Visible) |
| 58 | + { |
| 59 | + <!-- Content --> |
| 60 | + <FluentLayoutItem Area="@LayoutArea.Content" Padding="@Padding.All3"> |
| 61 | + <FluentText Weight="TextWeight.Bold">Content</FluentText> |
| 62 | + @BodyContent |
| 63 | + </FluentLayoutItem> |
| 64 | + } |
| 65 | + |
| 66 | + @if (Aside.Visible) |
| 67 | + { |
| 68 | + <!-- Aside --> |
| 69 | + <FluentLayoutItem Area="@LayoutArea.Aside" Width="120px" Sticky="Aside.Sticky" |
| 70 | + Style="padding: 8px; background-color: var(--colorBrandBackground2);"> |
| 71 | + <FluentText Weight="TextWeight.Bold">News</FluentText> |
| 72 | + @AsideContent |
| 73 | + </FluentLayoutItem> |
| 74 | + } |
| 75 | + |
| 76 | + @if (Footer.Visible) |
| 77 | + { |
| 78 | + <!-- Footer --> |
| 79 | + <FluentLayoutItem Area="@LayoutArea.Footer" Sticky="@Footer.Sticky"> |
| 80 | + © Microsoft @DateTime.Now.Year |
| 81 | + </FluentLayoutItem> |
| 82 | + } |
| 83 | + |
| 84 | + </FluentLayout> |
| 85 | + </div> |
| 86 | + |
| 87 | +</div> |
| 88 | + |
| 89 | +<h1>Standalone Hamburger</h1> |
| 90 | +<FluentLayoutHamburger Visible="true" |
| 91 | + Icon="@(new Icons.Regular.Size20.LineHorizontal4().WithColor(Color.Primary))"> |
| 92 | + Standalone Hamburger Content |
| 93 | +</FluentLayoutHamburger> |
| 94 | + |
| 95 | +@code |
| 96 | +{ |
| 97 | + protected void RenderOptions(RenderTreeBuilder __builder) |
| 98 | + { |
| 99 | + <table> |
| 100 | + <thead> |
| 101 | + <tr> |
| 102 | + <th>Area</th> |
| 103 | + <th>Visible</th> |
| 104 | + <th>Sticky</th> |
| 105 | + </tr> |
| 106 | + </thead> |
| 107 | + <tbody> |
| 108 | + <tr> |
| 109 | + <td>Global Scrollbar</td> |
| 110 | + <td><InputCheckbox @bind-Value="@(GlobalScrollbar)" /></td> |
| 111 | + </tr> |
| 112 | + <tr> |
| 113 | + <td>Menu Deferred Loading</td> |
| 114 | + <td><InputCheckbox @bind-Value="@(MenuDeferredLoading)" /></td> |
| 115 | + </tr> |
| 116 | + <tr> |
| 117 | + <td>Header</td> |
| 118 | + <td><InputCheckbox @bind-Value="@(Header.Visible)" /></td> |
| 119 | + <td><InputCheckbox @bind-Value="@(Header.Sticky)" /></td> |
| 120 | + </tr> |
| 121 | + <tr> |
| 122 | + <td>Menu</td> |
| 123 | + <td><InputCheckbox @bind-Value="@(Menu.Visible)" /></td> |
| 124 | + <td><InputCheckbox @bind-Value="@(Menu.Sticky)" /></td> |
| 125 | + </tr> |
| 126 | + <tr> |
| 127 | + <td>Content</td> |
| 128 | + <td><InputCheckbox @bind-Value="@(Content.Visible)" /></td> |
| 129 | + <td></td> |
| 130 | + </tr> |
| 131 | + <tr> |
| 132 | + <td>Aside</td> |
| 133 | + <td><InputCheckbox @bind-Value="@(Aside.Visible)" /></td> |
| 134 | + <td><InputCheckbox @bind-Value="@(Aside.Sticky)" /></td> |
| 135 | + </tr> |
| 136 | + <tr> |
| 137 | + <td>Footer</td> |
| 138 | + <td><InputCheckbox @bind-Value="@(Footer.Visible)" /></td> |
| 139 | + <td><InputCheckbox @bind-Value="@(Footer.Sticky)" /></td> |
| 140 | + </tr> |
| 141 | + </tbody> |
| 142 | + </table> |
| 143 | + } |
| 144 | +} |
0 commit comments