FileOpenPickerUI.Closing 事件

定义

当用户关闭文件选取器时触发。

// Register
event_token Closing(TypedEventHandler<FileOpenPickerUI, PickerClosingEventArgs const&> const& handler) const;

// Revoke with event_token
void Closing(event_token const* cookie) const;

// Revoke with event_revoker
FileOpenPickerUI::Closing_revoker Closing(auto_revoke_t, TypedEventHandler<FileOpenPickerUI, PickerClosingEventArgs const&> const& handler) const;
public event TypedEventHandler<FileOpenPickerUI,PickerClosingEventArgs> Closing;
function onClosing(eventArgs) { /* Your code */ }
fileOpenPickerUI.addEventListener("closing", onClosing);
fileOpenPickerUI.removeEventListener("closing", onClosing);
- or -
fileOpenPickerUI.onclosing = onClosing;
Public Custom Event Closing As TypedEventHandler(Of FileOpenPickerUI, PickerClosingEventArgs) 

事件类型

注解

作为文件提供程序,你可以注册此事件,以便你的应用可以在关闭之前执行清理任务。 例如,如果用户取消文件选取器,你可以通过清理在用户选择文件时添加到文件选取器中的临时文件来做出响应。

通过向 FileOpenPickerUI 添加事件侦听器并为事件分配处理程序函数来注册此事件。 可以从传递给事件处理程序的 PickerClosingEventArgs 对象访问有关事件的信息。

适用于