forked from MudBlazor/MudBlazor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MudSlider: Add nullable value parameter (MudBlazor#8881)
- Loading branch information
1 parent
d0b0545
commit fdb7151
Showing
12 changed files
with
469 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/MudBlazor.Docs/Pages/Components/Slider/Examples/SliderNullableExample.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@namespace MudBlazor.Docs.Examples | ||
|
||
<MudSlider T="int" @bind-Value="@_value" @bind-NullableValue="@_nullableValue" /> | ||
<div class="d-flex flex-column align-center"> | ||
<MudText Class="pb-4">@_value</MudText> | ||
<MudText Class="pb-4">Nullable Value: @(_nullableValue is null ? "null" : _nullableValue)</MudText> | ||
<MudButton @onclick="Reset" Variant="Variant.Filled" Color="Color.Primary">Reset to Null</MudButton> | ||
</div> | ||
|
||
@code { | ||
private int _value; | ||
private int? _nullableValue; | ||
|
||
private void Reset() => _nullableValue = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/MudBlazor.UnitTests.Viewer/TestComponents/Slider/SliderWithNullable.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@namespace MudBlazor.UnitTests.TestComponents | ||
|
||
<MudSlider T="double" @bind-NullableValue="NullableValue" Max="100.0" Min="0.0" Step="0.5" /> | ||
|
||
@code { | ||
public double? NullableValue { get; set; } | ||
} |
9 changes: 9 additions & 0 deletions
9
src/MudBlazor.UnitTests.Viewer/TestComponents/Slider/SliderWithTwoBindValues.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@namespace MudBlazor.UnitTests.TestComponents | ||
|
||
<MudSlider T="double" @bind-Value="Value" @bind-NullableValue="NullableValue" Max="100.0" Min="0.0" Step="0.5" /> | ||
|
||
@code { | ||
public double? NullableValue { get; set; } | ||
|
||
public double Value { get; set; } | ||
} |
Oops, something went wrong.