on_save

Function on_save 

Source
pub fn on_save(
    child: impl IntoUiNode,
    handler: Box<dyn FnMut(&CommandArgs) -> HandlerResult + Send>,
) -> UiNode
Expand description

P On save command.

Receives SAVE_CMD command events scoped on the widget. Usually saves to the last open or save path, otherwise prompt the user like on_save_as.

You can use WINDOWS.native_file_dialog to prompt the user for a file or folder path.

§Preview

You can preview this command event using on_pre_save. Otherwise the handler is only called after the widget content has a chance to stop propagation.

§Async

You can use async event handlers with this property.

§Enabled

You can use the can_save context property to disable the command handle. When disabled the handler is not called and the command handle signals as disabled.