WindowActivatedEventArgs 类

定义

包含 CoreWindow.Activated 事件返回的 Windows 激活状态信息。

public ref class WindowActivatedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class WindowActivatedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class WindowActivatedEventArgs
Public NotInheritable Class WindowActivatedEventArgs
继承
Object Platform::Object IInspectable WindowActivatedEventArgs
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

示例

void SetWindow(CoreWindow const & window)
{
    ...
    window.Activated({ this, &App::OnActivated });
}

// Activation event data in WindowActivatedEventArgs.
void OnActivated(Windows::UI::Core::CoreWindow const& /* sender */, Windows::UI::Core::WindowActivatedEventArgs const& /* args */) {}
// returning window activation events data through WindowActivatedEventArgs
void MyCoreWindowEvents::SetWindow( // implementation called by CoreApplication::Run(), provided for context
    _In_ CoreWindow^ window
    )
{
    // ...
    window->Activated +=
        ref new TypedEventHandler<CoreWindow^, WindowActivatedEventArgs^>(this, &CoreWindowEvents::OnWindowActivated);
    // ...
}

注解

此对象由为 CoreWindow.Activated 事件注册的委托返回。

注意

此类不是敏捷类,这意味着需要考虑其线程模型和封送处理行为。 有关详细信息,请参阅 线程处理和封送处理 (C++/CX)

属性

Handled

指定属性,该属性获取或设置是否处理了窗口激活事件。

WindowActivationState

获取引发 Activated 事件时窗口的激活状态。

适用于

另请参阅