mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-24 03:56:30 +00:00
26 lines
805 B
Plaintext
26 lines
805 B
Plaintext
<div class="option-display-box">
|
|
<div class="option-content">
|
|
<div class="option-title">@this.Name</div>
|
|
<div class="option-description">@this.Description</div>
|
|
</div>
|
|
<div class="option-control-with-label">
|
|
<FluentLabel class="label">@(this.Value ? "On" : "Off")</FluentLabel>
|
|
<FluentSwitch @bind-Value="this.Value" @bind-Value:after="this.OnToggleChanged" />
|
|
</div>
|
|
</div>
|
|
|
|
@inherits OptionBase<bool>
|
|
@code{
|
|
protected override bool ConvertValue(OptionInstance optionInstance, OptionProperty property)
|
|
{
|
|
var value = property.Getter(optionInstance) as bool?;
|
|
return value ?? false;
|
|
}
|
|
|
|
private void OnToggleChanged()
|
|
{
|
|
this.Property.Setter(this.Instance, this.Value);
|
|
this.NotifyValueChanged();
|
|
}
|
|
}
|