Enterprise-level component library based on Bootstrap and Blazor

star nuget license download repo commit master coverage

Handwritten

Used to save the mobile terminal signature as Base64 encoded string

Touch device handwritten signature as Base64.

Demo

Attributes

Loading...
@page "/handwrittenpage"

<h3>@Title</h3>

<h4>@SubTitle</h4>

<DemoBlock Title="@BaseUsageText" Introduction="@IntroText1" Name="Normal">
    <Handwritten HandwrittenBase64="((e) => { DrawBase64 = e; })" />
    <textarea type="text" class="form-control mt-3" readonly rows="5" @bind="DrawBase64" />
</DemoBlock>

<AttributeTable Items="@GetAttributes()" />
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/

using BootstrapBlazor.Shared.Common;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Localization;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace BootstrapBlazor.Shared.Samples;

/// <summary>
/// 
/// </summary>
public sealed partial class HandwrittenPage
{
    [NotNull]
    private string? Title { get; set; }

    [NotNull]
    private string? SubTitle { get; set; }

    [NotNull]
    private string? BaseUsageText { get; set; }

    [NotNull]
    private string? IntroText1 { get; set; }

    [NotNull]
    private string? IntroText2 { get; set; }

    [NotNull]
    private string? HandwrittenButtonText { get; set; }

    [Inject]
    [NotNull]
    private IStringLocalizer<HandwrittenPage>? Localizer { get; set; }


    /// <summary>
    /// 签名Base64
    /// </summary>
    public string? DrawBase64 { get; set; }

    /// <summary>
    /// OnInitialized 方法
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        Title ??= Localizer[nameof(Title)];
        SubTitle ??= Localizer[nameof(SubTitle)];
        BaseUsageText ??= Localizer[nameof(BaseUsageText)];
        IntroText1 ??= Localizer[nameof(IntroText1)];
        IntroText2 ??= Localizer[nameof(IntroText2)];
        HandwrittenButtonText ??= Localizer[nameof(HandwrittenButtonText)];
    }

    private IEnumerable<AttributeItem> GetAttributes() => new AttributeItem[]
    {
            new AttributeItem()
            {
                Name = "SaveButtonText",
                Description = Localizer["SaveButtonText"],
                Type = "string",
                ValueList = " — ",
                DefaultValue = Localizer["SaveButtonTextDefaultValue"]
            },
            new AttributeItem()
            {
                Name = "ClearButtonText",
                Description = Localizer["ClearButtonText"],
                Type = "string",
                ValueList = " — ",
                DefaultValue = Localizer["ClearButtonTextDefaultValue"]
            },
            new AttributeItem()
            {
                Name = "Result",
                Description = Localizer["Result"],
                Type = "string",
                ValueList = " — ",
                DefaultValue = " — "
            },
            new AttributeItem()
            {
                Name = "HandwrittenBase64",
                Description = Localizer["HandwrittenBase64"],
                Type = "EventCallback<string>",
                ValueList = " — ",
                DefaultValue = " — "
            }
    };
}

B 站相关视频链接

暂无

交流群

QQ Group:BootstrapAdmin & Blazor 795206915 675147445 Welcome to join the group discussion
Themes
Bootstrap
Motronic
Ant Design (完善中)
LayUI (完善中)
An error has occurred. This application may no longer respond until reloaded. Reload