Share via


WindowSizeChangedEventArgs Class

Definition

Contains the argument returned by a window size change event.

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
Inheritance
Object Platform::Object IInspectable WindowSizeChangedEventArgs
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Examples

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)
    // ...
}

Remarks

This object is returned by a delegate registered for the CoreWindow.SizeChanged event.

Note

This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX).

Properties

Handled

Gets or sets whether the window size event was handled.

Size

Gets the new size of the window in units of effective (view) pixels.

Applies to