-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathDateWheelPickerExample1.razor
More file actions
68 lines (65 loc) · 3.51 KB
/
DateWheelPickerExample1.razor
File metadata and controls
68 lines (65 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@namespace MudExtensions.Docs.Examples
@using MudBlazor.Extensions
<MudGrid>
<MudItem xs="12" sm="8">
<MudDateWheelPicker @bind-Value="_date" DateView="_dateView" Editable="_editable" Label="Date" Clearable InputAdornment="@(_isAdornmentEnd ? Adornment.End : Adornment.Start)"
ShowToolbar="_showToolbar" ShowHeader="_showHeader" SubmitOnClose="_submitOnClose" Variant="Variant.Outlined" Color="_color" ColorTime="_colorTime"
DateFormat="@_dateFormat" FixDay="_fixDay" FixMonth="_fixMonth" FixYear="_fixYear" FixHour="_fixHour" FixMinute="_fixMinute" FixSecond="_fixSecond"
TransformOrigin="Origin.TopCenter" AnchorOrigin="Origin.BottomCenter" />
</MudItem>
<MudItem xs="12" sm="4">
<MudStack Spacing="4">
<MudSelect @bind-Value="_dateView" Variant="Variant.Outlined" Label="Date View">
@foreach (DateView item in Enum.GetValues<DateView>())
{
<MudSelectItem Value="item">@item.ToDescriptionString()</MudSelectItem>
}
</MudSelect>
<MudSwitchM3 @bind-Value="_editable" Color="Color.Secondary" Label="Editable" />
<MudSwitchM3 @bind-Value="_showToolbar" Color="Color.Secondary" Label="Show Toolbar" />
<MudSwitchM3 @bind-Value="_showHeader" Color="Color.Secondary" Label="Show Header" />
<MudSwitchM3 @bind-Value="_submitOnClose" Color="Color.Secondary" Label="Submit On Close" />
<MudSwitchM3 @bind-Value="_isAdornmentEnd" Label="Adornment End" Color="Color.Secondary" />
<MudSelect @bind-Value="_color" Variant="Variant.Outlined" Label="Color">
@foreach (Color item in Enum.GetValues<Color>())
{
<MudSelectItem Value="item">@item.ToDescriptionString()</MudSelectItem>
}
</MudSelect>
<MudSelect @bind-Value="_colorTime" Variant="Variant.Outlined" Label="Color Time">
@foreach (Color item in Enum.GetValues<Color>())
{
<MudSelectItem Value="item">@item.ToDescriptionString()</MudSelectItem>
}
</MudSelect>
<div class="d-flex flex-wrap">
<MudCheckBox @bind-Value="_fixDay" Label="Fix Day" Color="Color.Secondary" />
<MudCheckBox @bind-Value="_fixMonth" Label="Fix Month" Color="Color.Secondary" />
<MudCheckBox @bind-Value="_fixYear" Label="Fix Year" Color="Color.Secondary" />
<MudCheckBox @bind-Value="_fixHour" Label="Fix Hour" Color="Color.Secondary" />
<MudCheckBox @bind-Value="_fixMinute" Label="Fix Minute" Color="Color.Secondary" />
<MudCheckBox @bind-Value="_fixSecond" Label="Fix Second" Color="Color.Secondary" />
</div>
<MudTextField @bind-Value="_dateFormat" Variant="Variant.Outlined" Label="Date Format" />
<MudButton OnClick="@(() => _date = DateTime.Now)">Set Today</MudButton>
</MudStack>
</MudItem>
</MudGrid>
@code {
DateTime? _date = DateTime.Now;
DateView _dateView = DateView.Date;
bool _editable = false;
bool _showToolbar = false;
bool _showHeader = false;
bool _submitOnClose = true;
Color _color;
Color _colorTime = Color.Inherit;
string _dateFormat = System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern;
bool _fixYear;
bool _fixMonth;
bool _fixDay;
bool _fixHour;
bool _fixMinute;
bool _fixSecond;
bool _isAdornmentEnd = true;
}