Toolbar mode lets you organise actions in an MDriven Turnkey ViewModel so that safe top-level navigation stays separate from actions that edit data or act on a selected nested item.
What toolbar mode changes
Toolbar mode is an optional MDriven Turnkey UI style. It reduces the left-side action area and gives each ViewModel a horizontal toolbar below the main menu.
The layout separates actions by both their target and their effect:
| Action type | Where it appears in toolbar mode | Example |
|---|---|---|
| Top-level navigation that does not change data | Left-side action area | An action that opens another ViewModel for the current customer without editing the customer. |
| Root-level actions that change data, including navigation actions with side effects | Horizontal toolbar below the main menu | Save, Cancel, Edit (the ReadOnly switch), or an action that changes the current customer before navigating. |
| Actions on nested objects, such as rows in a grid | Context menu for the selected object | An action on an order line is available from that line's context menu rather than the ViewModel's top-level action area. |
This separation makes the left-side area predictable: it is intended for ViewModel-top-level navigation with no side effects. Actions that can change data are kept out of that area.
Enable toolbar mode for one ViewModel
Use a TaggedValue when you want toolbar mode only on selected ViewModels.
- Open the ViewModel in MDriven Designer's ViewModel Editor.
- Select the ViewModel's top level.
- Add the TaggedValue
Toolbarwith the valuetrue. - Save the model and run the ViewModel in Turnkey.
For example, set Toolbar=true on an Order ViewModel to try the layout for order handling while other ViewModels retain their existing action layout.
Enable toolbar mode globally
Use the global setting when toolbar mode should be the default for your application.
- Add the class
SysMDrivenMiscSettingsSingletonto the model and mark it as a Singleton. - Add the Boolean attribute
GlobalToolbarMode. - Set
GlobalToolbarModetotrueon the singleton instance. - Restart MDrivenServer. This setting is read when the system starts.
- Review ViewModels that need the previous layout and set
Toolbar=falseon their top-level ViewModel TaggedValue.
When GlobalToolbarMode=true, toolbar mode is used for every ViewModel except a ViewModel explicitly marked Toolbar=false.
| GlobalToolbarMode | ViewModel TaggedValue Toolbar | Result |
|---|---|---|
| false or not enabled | true | Toolbar mode is enabled for that ViewModel. |
| true | Not set | Toolbar mode is enabled. |
| true | false | Toolbar mode is disabled for that ViewModel. |
For the recognised settings class and its other server settings, see Documentation:SysMDrivenMiscSettingsSingleton.
Design actions for the layout
Toolbar mode uses the action's placement and whether MDriven can determine that the action changes data. The available action render positions are:
LeftSideContextMenuToolBarLeftToolBarRight
Configure and review actions in the Actions Editor. Keep actions aimed at the current ViewModel's root separate from actions aimed at objects displayed inside the ViewModel.
Put only non-changing, top-level navigation in the left-side area. For example, an action that opens a related Customer ViewModel without modifying the current Order is suitable there.
Do not use this area for Save, Cancel, Edit, or an action that creates, deletes, updates, or otherwise changes data. Those actions belong in the horizontal toolbar.
An action that applies to a grid row must be available from that object's context menu. This makes the target clear: the user invokes the action while focused on the row it affects.
For example, if an Order ViewModel shows order lines, an action that applies to one order line is accessed from the order-line context menu, not from the root ViewModel's left-side navigation.
ReadOnly analysis is important
The split between non-changing navigation and data-changing actions relies on MDriven's ReadOnly functionality being able to deduce whether an action changes data. Review actions whose behaviour is not obvious, especially actions that navigate after making a change.
For example, an action named Open customer may be left-side navigation if it only opens the customer. If it first updates the order and then opens the customer, it is a data-changing action and belongs in the toolbar.
Roll out safely
- Start with
Toolbar=trueon one representative ViewModel. - Test all root-level actions: navigation, Save, Cancel, and Edit.
- Test each grid or nested-object action from its context menu.
- Confirm that actions which change data are not presented as safe left-side navigation.
- Enable
GlobalToolbarModeonly after reviewing the affected ViewModels; useToolbar=falseas an opt-out for exceptions.
Client availability
The toolbar mode demonstrated for Turnkey is not available in WPF. Verify the target UI engine during testing if your application uses more than one client.
