WindowSizeChangedEventArgs 类

定义

包含窗口大小更改事件返回的参数。

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

Windows 要求

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

示例

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

// Size changed data in WindowSizeChangedEventArgs.
void OnWindowSizeChanged(Windows::UI::Core::CoreWindow const& /* sender */, Windows::UI::Core::WindowSizeChangedEventArgs const& /* args */) {}
// returning window size change events data through WindowSizeChangedEventArgs
void MyCoreWindowEvents::SetWindow( // implementation called by CoreApplication::Run(), provided for context
    _In_ CoreWindow^ window
    )
{
    // ...
    window->SizeChanged +=
        ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &CoreWindowEvents::OnWindowSizeChanged)
    // ...
}

注解

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

注意

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

属性

Handled

获取或设置是否处理了窗口大小事件。

Size

获取窗口的新大小(以有效 (视图) 像素为单位)。

适用于