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
      • File Upload Functionality
      • Async/Await Feature for WebMap 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
        • CheckBox
        • CheckedListBox
        • ComboBox
        • DateTimePicker
        • Form
        • ListBox
        • ListView
          • WMListViewDetails
        • Mdi Container Component
        • MenuStrip
        • MessageBox
        • MonthCalendar
        • Panel
        • PictureBox
        • ProgressBar
        • RadioButton
        • StatusStrip
        • ToolStripStatusLabel
        • TabControl
        • TabPage
        • TextBox
        • ToolStrip
          • ToolStripButton
          • ToolStripLabel
          • ToolStripSeparator
        • ToolTip
    • 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
  • Dynamic Rendering
  • Styles
  • Events
Export as PDF
  1. WebMap Blazor
  2. DCP: Desktop Compatibility Library
  3. Components Information

ToolStrip

Description

This component represents a horizontal or vertical toolbar in Blazor using the Gap.Blazor.ToolStrip model. It uses the Telerik ToolBar component to render a collection of interactive items such as buttons, labels, and separators. The component supports tooltips, autosizing, and dynamic item rendering.

Usage

<WMStyleBase model=@toolStrip></WMStyleBase>

@if (toolStrip.ShowItemToolTips)
{
    <WMToolTipComponent model=@toolStrip.ToolTip></WMToolTipComponent>
}

<TelerikToolBar Class=@($"{this.toolStrip.GetStringClasses()} {GetAutoSizeClass()}")>
    @foreach (var item in toolStrip.Items)
    {
        @if (item is ToolStripLabel toolStripLabel)
        {
            <WMToolStripLabel model=@toolStripLabel></WMToolStripLabel>
        }
        @if (item is ToolStripButton toolStripButton)
        {
            <WMToolStripButton model=@toolStripButton></WMToolStripButton>
        }
        @if (item is ToolStripSeparator toolStripSeparator)
        {
            <WMToolStripSeparator model=@toolStripSeparator></WMToolStripSeparator>
        }
    }
</TelerikToolBar>

<style>
    .@model.GetComponentClass() {
        padding: 1px;
        align-items: stretch;
    }

    .@(model.GetComponentClass() + ".AutoSize") {
        height: auto;
    }
</style>

Properties

  • toolStrip: Instance of the Gap.Blazor.ToolStrip model.

  • Items: A collection of ToolStripItem objects, including:

    • ToolStripLabel

    • ToolStripButton

    • ToolStripSeparator

  • ShowItemToolTips: Boolean indicating whether tooltips should be displayed.

  • ToolTip: Tooltip model used when ShowItemToolTips is enabled.

Methods

  • GetAutoSizeClass(): Returns "AutoSize" if the toolbar should automatically adjust its height.

Dynamic Rendering

  • TelerikToolBar: Renders the toolbar container.

  • WMToolStripLabel / Button / Separator: Rendered dynamically based on the item type.

  • WMToolTipComponent: Conditionally rendered if tooltips are enabled.

Styles

.@model.GetComponentClass() {
    padding: 1px;
    align-items: stretch;
}

.@model.GetComponentClass().AutoSize {
    height: auto;
}

Events

  • No direct events in this component, but individual items (e.g., buttons) may trigger their own events.

PreviousTextBoxNextToolStripButton

Last updated 2 days ago