WebMap for Blazor
  • WebMap Blazor
    • Modernization
      • Overview
      • Modernization Challenges
      • Our solution
      • What is Blazor?
      • How does Blazor Work?
      • Windows Forms in Blazor
      • Deployment
      • Interfacing with hardware devices
    • Research for Blazor
      • Handling Reference Parameters in Async Methods with Ref<T>
      • Alternatives to Async Properties in C#
      • Issue with using "MessageBox.Show" in Blazor
    • Assessment Tool
    • Conversion Tool
      • Getting Started
      • Modals and Dialogs
      • Static Service Management
      • ImageListStreamer
      • Solution and Project Structure
        • Solution Generator
    • DCP: Desktop Compatibility Library
      • API Documentation
        • Blazor DCP: Gap.Blazor.Application Class Reference
      • Components Information
        • Button Component
        • Application Data Component
        • GroupBox Component
        • Label Component
    • Post Conversion
      • How To?
        • Create a new WebMap Window?
        • Create a new WebMap Component?
        • Create a native Blazor Window in a WebMap app?
        • Create a native Blazor Component in a WebMap Window?
        • Change the default WebMap visual layout?
    • WebMap: Angular vs Blazor
      • Footprint
      • Binaries size
      • Chatiness
      • Performance
      • Extensibility
      • Maintainability
      • Debugging
      • Project Structure
    • WebMap for Blazor Release Notes
      • Beta version
    • FAQ
    • Errors and Troubleshooting
    • License
Powered by GitBook
On this page
  • Description
  • Usage
  • Properties
  • Methods
  • Events
  • Styles
Export as PDF
  1. WebMap Blazor
  2. DCP: Desktop Compatibility Library
  3. Components Information

Button Component

Description

This component represents a button in Blazor using the Gap.Blazor.Button model. The button is rendered using the TelerikButton component and is dynamically styled based on the properties of the model.

Usage

@using Gap.Blazor
@using Gap.Blazor.Components
@using Telerik.Blazor.Components
@inherits WMControlComponentBase
@namespace Gap.Blazor.Components

<WMStyleBase model=@buttonModel></WMStyleBase>
<div @onkeydown="@keyDownHandler">
    <TelerikButton Class="@(buttonModel.GetStringClasses()+" "+ buttonModel.GetToolTipClass())" Title="@buttonModel.ToolTipText" Visible=@buttonModel.Visible Enabled=@buttonModel.Enabled 
OnClick=@onClickHandler ThemeColor=@(ThemeConstants.Button.ThemeColor.Base) @ref="elementRef"
    TabIndex=@TabIndex>@buttonModel.Text</TelerikButton>
</div>

<style>
    .@model.GetComponentClass(){
        background-color: @GetBackColorHex();
    }
</style>

Properties

  • buttonModel: Instance of the Gap.Blazor.Button model.

  • elementRef: Reference to the TelerikButton element.

Methods

  • onClickHandler(): Handles the button click event.

  • Focus(): Method to focus the button.

  • GetBackColorHex(): Gets the button's background color in hexadecimal format.

Events

  • OnClick: Event triggered when the button is clicked.

Styles

The button's style is dynamically defined using the GetComponentClass() method, and the background color is obtained through GetBackColorHex().

PreviousComponents InformationNextApplication Data Component

Last updated 10 days ago