Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<FluentDatePicker Name="production_date" Id="proddate" @bind-Value="starship.ProductionDate" Label="Production Date" Required />
<FluentValidationMessage For="@(() => starship.ProductionDate)" />
</div>
<div>
<FluentSwitch Name="teleporter" @bind-value="starship.HasTeleporter" Label="Teleporter" CheckedMessage="Fully operational" UncheckedMessage="Under maintenance"/>
<FluentValidationMessage For="@(() => starship.HasTeleporter)" />
</div>
<FluentButton Type="ButtonType.Submit" Appearance="Appearance.Accent">Submit</FluentButton>
</FluentStack>
</EditForm>
Expand Down
2 changes: 2 additions & 0 deletions examples/Demo/Shared/SampleData/Starship.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ public class Starship

[Required]
public DateTime? ProductionDate { get; set; }

public bool HasTeleporter { get; set; }
}
6 changes: 3 additions & 3 deletions src/Core/Components/Switch/FluentSwitch.razor
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@namespace Microsoft.FluentUI.AspNetCore.Components
@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentInputBase<bool>
<fluent-switch @ref=Element
class="@ClassValue"
style="@StyleValue"
readonly=@ReadOnly
id=@Id
value=@Value
current-value=@CurrentValue


disabled=@Disabled
name=@Name
aria-label="@(string.IsNullOrEmpty(AriaLabel) ? Label : AriaLabel)"
Expand Down