-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathBarcodeExample1.razor
More file actions
36 lines (33 loc) · 2.13 KB
/
BarcodeExample1.razor
File metadata and controls
36 lines (33 loc) · 2.13 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
@namespace MudExtensions.Docs.Examples
@using ZXing;
<MudGrid>
<MudItem xs="12" sm="8" Class="d-flex justify-center">
<MudBarcode @ref="_barcode" @bind-Value="_qrValue" Width="_width" Height="_height" ForceHeight="_forceHeight" BarcodeFormat="_barcodeFormat" Clickable="_clickable" Color="@_color" BackgroundColor="@_backgroundColor" StrokeWidth="_strokeWidth" />
</MudItem>
<MudItem xs="12" sm="4">
<MudStack Spacing="3">
<MudTextField T="string" @bind-Value="_qrValue" Label="Value" Variant="Variant.Outlined" Immediate="true" Margin="Margin.Dense" />
<MudNumericField @bind-Value="_width" Label="Width" Variant="Variant.Outlined" Margin="Margin.Dense" />
<MudNumericField @bind-Value="_height" Label="Height" Variant="Variant.Outlined" Margin="Margin.Dense" />
<MudNumericField @bind-Value="_forceHeight" Label="ForceHeight" Variant="Variant.Outlined" Margin="Margin.Dense" />
<MudSelectExtended ItemCollection="@(Enum.GetValues<BarcodeFormat>())" @bind-Value="_barcodeFormat" Label="Barcode Format" Variant="Variant.Outlined" Margin="Margin.Dense" Dense="true" />
<MudText Color="Color.Error">@(_barcode?.ErrorText == null ? null : "Error: " + _barcode.ErrorText)</MudText>
<MudSwitchM3 @bind-Value="_clickable" Color="Color.Secondary" Label="Clickable" />
<MudTextField T="string" @bind-Value="_color" Label="Color" Variant="Variant.Outlined" Immediate="true" Margin="Margin.Dense" />
<MudTextField T="string" @bind-Value="_backgroundColor" Label="BackgroundColor" Variant="Variant.Outlined" Immediate="true" Margin="Margin.Dense" />
<MudNumericField @bind-Value="_strokeWidth" Label="StrokeWidth" Min="0" Max="10" Variant="Variant.Outlined" Margin="Margin.Dense" />
</MudStack>
</MudItem>
</MudGrid>
@code {
MudBarcode? _barcode;
string? _qrValue;
int _width = 200;
int _height = 200;
int _forceHeight = 1;
BarcodeFormat _barcodeFormat = BarcodeFormat.QR_CODE;
bool _clickable = false;
string _color = "black";
string _backgroundColor = "white";
int _strokeWidth = 0;
}