CoreWindowResizeManager 类

定义

定义用于管理 CoreWindow.SizeChanged 事件的类型。 此类型由框架 ((如 XAML) 或实现自己的 IFrameWorkView 的应用)使用,以同步 shell 绘制的 placholder ((如初始屏幕) )与应用第一个绘制帧之间的切换,以便在从一个帧到另一个帧的转换中没有间隙。 如果应用未实现 IFrameWorkView 本身,则不应参与此同步,因为框架会为你执行此同步。

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

Windows 要求

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

注解

触发 CoreWindow.SizeChanged 时,调用静态 CoreWindowResizeManager.GetForCurrentView 方法以获取当前 CoreWindow 的此类型的实例。

if (m_windowSizeChangeInProgress)
{
    // A window size change has been initiated and the app has just completed presenting
    // the first frame with the new size. Notify the resize manager so that we can abbreviate
    // any resize animation and prevent unnecessary delays.
    Windows::UI::Core::CoreWindowResizeManager::GetForCurrentView().NotifyLayoutCompleted();
    m_windowSizeChangeInProgress = false;
}
if (m_windowSizeChangeInProgress)
{
 // A window size change has been initiated and the app has just completed presenting
 // the first frame with the new size. Notify the resize manager so we can abbreviate
 // any resize animation and prevent unnecessary delays.
 CoreWindowResizeManager::GetForCurrentView()->NotifyLayoutCompleted();
 m_windowSizeChangeInProgress = false;
}

属性

ShouldWaitForLayoutCompletion

获取或设置调用方是否应等待新布局完成。

方法

GetForCurrentView()

获取正在运行的应用当前 CoreWindow 的 CoreWindowResizeManager 实例。

NotifyLayoutCompleted()

通知父 CoreWindow 对象新布局已完成。

适用于