on_pre_open

Function on_pre_open 

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

P On open command.

Receives OPEN_CMD command events scoped on the widget. The command parameter can be a path to open, otherwise the path must be derived from context or the user prompted.

§Command

This property will subscribe to the OPEN_CMD command scoped on the widget. If set on the Window! root widget it will also subscribe to the command scoped on the window.

The command handle is enabled by default and can be disabled using the contextual property can_open .

§Route

This event property uses the preview route, that is, the handler is called before the children widget handlers and before the $pn_ident handlers.