You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.4 KiB

10 months ago
@page "/"
@rendermode RenderMode.InteractiveServer
10 months ago
<PageTitle>Home</PageTitle>
10 months ago
<FluentCard Width="auto" Height="auto">
<h2>Hello Fluent UI!</h2>
<FluentIcon Value="@(new Icons.Regular.Size24.EmojiSmileSlight())" />
<FluentIcon Value="@(Icon.FromImageUrl("/favicon.ico"))" />
<FluentIcon Value="@(new Icons.Regular.Size24.EmojiSmileSlight())" />
<h2 class="mt-5">Change Theme</h2>
<FluentGrid>
<FluentGridItem>
<FluentSelect Label="Theme"
Width="250px"
Items="@(Enum.GetValues<DesignThemeModes>())"
@bind-SelectedOption="@Mode" />
</FluentGridItem>
<FluentGridItem>
<FluentSelect Label="Color"
Items="@(Enum.GetValues<OfficeColor>().Select(i => (OfficeColor?)i))"
Height="200px"
Width="250px"
@bind-SelectedOption="@OfficeColor">
</FluentSelect>
</FluentGridItem>
</FluentGrid>
10 months ago
<FluentStack Class="m-3 p-3 fluent-border-s1" HorizontalAlignment="HorizontalAlignment.Center" Orientation="Orientation.Vertical" VerticalGap="5">
<FluentIcon Value="@(new Icons.Regular.Size24.Airplane())" />
<FluentLabel>Example of content</FluentLabel>
10 months ago
<FluentButton Appearance="Appearance.Neutral">Neutral</FluentButton>
<FluentButton Appearance="Appearance.Accent">Accent</FluentButton>
10 months ago
<FluentButton Appearance="Appearance.Stealth">Stealth</FluentButton>
<FluentButton Appearance="Appearance.Outline">Outline</FluentButton>
<FluentButton Appearance="Appearance.Lightweight">Lightweight</FluentButton>
</FluentStack>
</FluentCard>
<FluentDesignTheme @bind-Mode="@Mode"
@bind-OfficeColor="@OfficeColor"
OnLoaded="@OnLoaded"
OnLuminanceChanged="@OnLuminanceChanged"
StorageName="theme" />
@code
{
public DesignThemeModes Mode { get; set; }
public OfficeColor? OfficeColor { get; set; }
void OnLoaded(LoadedEventArgs e)
{
// DemoLogger.WriteLine($"Loaded: {(e.Mode == DesignThemeModes.System ? "System" : "")} {(e.IsDark ? "Dark" : "Light")}");
}
10 months ago
void OnLuminanceChanged(LuminanceChangedEventArgs e)
{
// DemoLogger.WriteLine($"Changed: {(e.Mode == DesignThemeModes.System ? "System" : "")} {(e.IsDark ? "Dark" : "Light")}");
}
}