IOperationServiceAddButtonToDeliveryOrderEditScreen Method |
Adds a button to the delivery order edit screen.
Namespace: Resto.Front.ApiAssembly: Resto.Front.Api.V9 (in Resto.Front.Api.V9.dll)
Syntax(Guid buttonId, IDisposable buttonRegistration) AddButtonToDeliveryOrderEditScreen(
string caption,
bool isChecked,
bool isEnabled,
Action<(IDeliveryOrder order, IOperationService os, IViewManager vm, (Guid , string , bool , string ) state)> callback,
string iconGeometry = null
)
Parameters
- caption String
-
Text to display on the button.
- isChecked Boolean
-
Indicates whether the button is checked.
- isEnabled Boolean
-
Is the button available for user interaction.
- callback ActionValueTupleIDeliveryOrder, IOperationService, IViewManager, ValueTupleGuid, String, Boolean, String
-
Button click event handler.
- iconGeometry String (Optional)
-
Path geometry to show icon on the button. Path markup syntax is described here: https://docs.microsoft.com/en-us/dotnet/desktop/wpf/graphics-multimedia/path-markup-syntax?view=netframeworkdesktop-4.8
Return Value
ValueTupleGuid,
IDisposable
Method returns the buttonId and the buttonRegistration. Use the method's buttonRegistration property in the return value to remove the button or it will be automatically removed when plugin is unloaded. Use the method's buttonId property in the return value to identify the button for updates.
Remarks
Before the callback is invoked, the delivery order is saved the same way as when the user saves it manually, including all validations. If saving fails (e.g. the delivery has no items or required fields are not filled), the callback is not invoked. The callback receives the saved delivery order; after the callback, the edit screen reloads the order from the database.
See Also