इसके माध्यम से साझा किया गया


WindowSizeChangedEventHandler Delegate

Definition

Represents the method that will handle the Window.SizeChanged event.

public delegate void WindowSizeChangedEventHandler(Platform::Object ^ sender, WindowSizeChangedEventArgs ^ e);
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(1545717570, 11501, 20441, 186, 56, 113, 24, 212, 14, 150, 107)]
class WindowSizeChangedEventHandler : MulticastDelegate
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(1545717570, 11501, 20441, 186, 56, 113, 24, 212, 14, 150, 107)]
public delegate void WindowSizeChangedEventHandler(object sender, WindowSizeChangedEventArgs e);
Public Delegate Sub WindowSizeChangedEventHandler(sender As Object, e As WindowSizeChangedEventArgs)

Parameters

sender
Object

Platform::Object

IInspectable

The object where the handler is attached.

e
WindowSizeChangedEventArgs

Event data for the event.

Attributes

Windows requirements

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

Remarks

The SizeChanged event fires when the Window size changes. There are multiple reasons why the Window size of an app might change. These reasons include changes to device orientation that result in a redraw of the current app UI, or the user resizes the app. By handling the SizeChanged event, an app can determine what the current app view is in order to modify their UI. This gives your app code a chance to assure that the elements are presented correctly for the new window size and shape. If the view state is changing to a narrow width, this often means that you are making choices about which UI elements should remain displayed and which should be hidden until the app is restored to a wider view. SizeChanged is an important event to handle because the multiple views that your UWP app can offer are controlled by the user and can change at any time.

Applies to

See also