SettingsPane.CommandsRequested 事件

定义

注意

SettingsPane 已弃用,可能不适用于所有版本的 Windows 10。 无需使用 SettingsPane,而是将设置选项集成到应用体验中。 有关详细信息,请参阅 应用设置指南

当用户打开设置窗格时发生。 侦听此事件可让应用初始化设置命令并暂停其 UI,直到用户关闭窗格。

在此事件期间,请将 SettingsCommand 对象追加到可用的 ApplicationCommands 向量,使其可用于 SettingsPaneUI。

/// [add: Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.UI.ApplicationSettings.ApplicationsSettingsContract)]
/// [remove: Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.UI.ApplicationSettings.ApplicationsSettingsContract)]
// Register
event_token CommandsRequested(TypedEventHandler<SettingsPane, SettingsPaneCommandsRequestedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
SettingsPane::CommandsRequested_revoker CommandsRequested(auto_revoke_t, TypedEventHandler<SettingsPane, SettingsPaneCommandsRequestedEventArgs const&> const& handler) const;
/// [add: Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.UI.ApplicationSettings.ApplicationsSettingsContract")]
/// [remove: Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.UI.ApplicationSettings.ApplicationsSettingsContract")]
// Register
event_token CommandsRequested(TypedEventHandler<SettingsPane, SettingsPaneCommandsRequestedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
SettingsPane::CommandsRequested_revoker CommandsRequested(auto_revoke_t, TypedEventHandler<SettingsPane, SettingsPaneCommandsRequestedEventArgs const&> const& handler) const;
[add: Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.UI.ApplicationSettings.ApplicationsSettingsContract))]
[remove: Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.UI.ApplicationSettings.ApplicationsSettingsContract))]
public event TypedEventHandler<SettingsPane,SettingsPaneCommandsRequestedEventArgs> CommandsRequested;
[add: Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.UI.ApplicationSettings.ApplicationsSettingsContract")]
[remove: Windows.Foundation.Metadata.Deprecated("SettingsPane is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.UI.ApplicationSettings.ApplicationsSettingsContract")]
public event TypedEventHandler<SettingsPane,SettingsPaneCommandsRequestedEventArgs> CommandsRequested;
function onCommandsRequested(eventArgs) { /* Your code */ }
settingsPane.addEventListener("commandsrequested", onCommandsRequested);
settingsPane.removeEventListener("commandsrequested", onCommandsRequested);
- or -
settingsPane.oncommandsrequested = onCommandsRequested;
Public Custom Event CommandsRequested As TypedEventHandler(Of SettingsPane, SettingsPaneCommandsRequestedEventArgs) 

事件类型

属性

适用于