API: Bars/Ribbon Controls

Riferimento API per barre menu, toolbar e ribbon.

TWvdSBarManager

Gestore per menu e toolbar.

Namespace

WvdS.UI.Controls.Bars

PXAML

<BarManager>
  <BarManager.MainMenu>
    <Bar>
      <BarSubItem Caption="File">
        <BarButton Caption="New" Command="{Binding NewCommand}" Shortcut="Ctrl+N" />
        <BarButton Caption="Open" Command="{Binding OpenCommand}" Shortcut="Ctrl+O" />
        <BarSeparator />
        <BarButton Caption="Exit" Command="{Binding ExitCommand}" />
      </BarSubItem>
      <BarSubItem Caption="Edit">
        <BarButton Caption="Undo" Command="{Binding UndoCommand}" Shortcut="Ctrl+Z" />
        <BarButton Caption="Redo" Command="{Binding RedoCommand}" Shortcut="Ctrl+Y" />
      </BarSubItem>
    </Bar>
  </BarManager.MainMenu>
  <BarManager.Toolbars>
    <Bar Name="Standard">
      <BarButton Caption="New" Icon="new" Command="{Binding NewCommand}" />
      <BarButton Caption="Open" Icon="open" Command="{Binding OpenCommand}" />
      <BarButton Caption="Save" Icon="save" Command="{Binding SaveCommand}" />
    </Bar>
  </BarManager.Toolbars>
</BarManager>

Properties

Property Tipo Default Descrizione
MainMenu TBar nil Menu principale
Toolbars TBarCollection nil Toolbar
PopupMenus TPopupMenuCollection nil Menu contestuali
AllowCustomization Boolean True Personalizzazione permessa

TWvdSRibbonControl

Ribbon stile Microsoft Office.

Namespace

WvdS.UI.Controls.Bars

PXAML

<RibbonControl ApplicationButtonText="File">
  <RibbonControl.ApplicationMenu>
    <RibbonApplicationMenu>
      <BarButton Caption="New" Icon="new" Command="{Binding NewCommand}" />
      <BarButton Caption="Open" Icon="open" Command="{Binding OpenCommand}" />
      <BarButton Caption="Save" Icon="save" Command="{Binding SaveCommand}" />
      <BarSeparator />
      <BarButton Caption="Exit" Command="{Binding ExitCommand}" />
    </RibbonApplicationMenu>
  </RibbonControl.ApplicationMenu>
 
  <RibbonPage Caption="Home">
    <RibbonGroup Caption="Clipboard">
      <BarButton Caption="Paste" Icon="paste" Size="Large" />
      <BarButton Caption="Cut" Icon="cut" />
      <BarButton Caption="Copy" Icon="copy" />
    </RibbonGroup>
    <RibbonGroup Caption="Font">
      <BarEditItem>
        <ComboBoxEdit Width="100" ItemsSource="{Binding Fonts}" />
      </BarEditItem>
      <BarButton Caption="Bold" Icon="bold" IsToggle="True" />
      <BarButton Caption="Italic" Icon="italic" IsToggle="True" />
    </RibbonGroup>
  </RibbonPage>
 
  <RibbonPage Caption="Insert">
    <RibbonGroup Caption="Tables">
      <BarButton Caption="Table" Icon="table" Size="Large" />
    </RibbonGroup>
  </RibbonPage>
</RibbonControl>

Properties

Property Tipo Default Descrizione
Pages TRibbonPageCollection nil Pagine ribbon
SelectedPage TRibbonPage nil Pagina attiva
ApplicationButtonText string | Testo pulsante app | ^ ApplicationMenu | TRibbonApplicationMenu | nil | Menu app | ^ QuickAccessToolbar | TBar | nil | Accesso rapido | ^ IsMinimized | Boolean | False | Ribbon minimizzato | ^ Style | TRibbonStyle | rsOffice2019 | Office2007, Office2010, Office2013, Office2016, Office2019 | —- ===== TWvdSRibbonPage ===== Pagina ribbon (tab). ==== Namespace ==== WvdS.UI.Controls.Bars ==== Properties ==== | Property | Tipo | Default | Descrizione | ^ Caption | string | Titolo tab
Groups TRibbonGroupCollection nil Gruppi
IsVisible Boolean True Visibile
ContextualTabGroup string | Tab contestuale | —- ===== TWvdSRibbonGroup ===== Gruppo ribbon all'interno di una pagina. ==== Namespace ==== WvdS.UI.Controls.Bars ==== Properties ==== | Property | Tipo | Default | Descrizione | ^ Caption | string | Nome gruppo
Items TBarItemCollection nil Item contenuti
ShowDialogLauncher Boolean False Dialog-Launcher
CollapsePriority Integer 0 Priorita collapse

TWvdSBarButton

Pulsante toolbar/menu.

Namespace

WvdS.UI.Controls.Bars

PXAML

<BarButton Caption="Save"
           Icon="save"
           Command="{Binding SaveCommand}"
           Shortcut="Ctrl+S"
           Hint="Save the current document" />

Properties

Property Tipo Default Descrizione
Caption string | Testo pulsante | ^ Icon | TWvdSImageSource | nil | Icona | ^ Command | IWvdSCommand | nil | Command | ^ Shortcut | string | Scorciatoia tastiera
Hint string | Tooltip | ^ Size | TBarButtonSize | bsSmall | Small, Large | ^ IsToggle | Boolean | False | Pulsante toggle | ^ IsPressed | Boolean | False | Stato toggle | ^ IsEnabled | Boolean | True | Abilitato | ==== Events ==== | Event | Firma | Descrizione | ^ OnClick | TNotifyEvent | Pulsante cliccato | —- ===== TWvdSBarSubItem ===== Sottomenu. ==== Namespace ==== WvdS.UI.Controls.Bars ==== PXAML ==== <code xml> <BarSubItem Caption=„Recent Files“> <BarButton Caption=„Document1.txt“ /> <BarButton Caption=„Document2.txt“ /> <BarSeparator /> <BarButton Caption=„Clear Recent“ /> </BarSubItem> </code> ==== Properties ==== | Property | Tipo | Default | Descrizione | ^ Caption | string | Testo menu
Icon TWvdSImageSource nil Icona
Items TBarItemCollection nil Item sottomenu

TWvdSBarEditItem

Editor in toolbar/menu.

Namespace

WvdS.UI.Controls.Bars

PXAML

<BarEditItem Caption="Zoom:">
  <SpinEdit Value="{Binding ZoomLevel}"
            Minimum="25" Maximum="400"
            Width="80" />
</BarEditItem>

Properties

Property Tipo Default Descrizione
Caption string

PXAML

<DataGrid ContextMenu="{StaticResource GridContextMenu}" />
 
<PopupMenu x:Key="GridContextMenu">
  <BarButton Caption="Edit" Command="{Binding EditCommand}" />
  <BarButton Caption="Delete" Command="{Binding DeleteCommand}" />
  <BarSeparator />
  <BarSubItem Caption="Export">
    <BarButton Caption="Excel" Command="{Binding ExportExcel}" />
    <BarButton Caption="PDF" Command="{Binding ExportPdf}" />
  </BarSubItem>
</PopupMenu>

Properties

Property Tipo Default Descrizione
Items TBarItemCollection nil Item menu

Metodi

Metodo Descrizione
ShowAt(x, y) Mostra menu alla posizione
ShowAtCursor Mostra menu al cursore
Close Chiudi menu

Vedi anche

Zuletzt geändert: il 29/01/2026 alle 22:38