Share via


CoreWindowResizeManager 類別

定義

定義用來管理 CoreWindow.SizeChanged 事件的型別。 此類型由架構 (例如 XAML) 或實作自己的 IFrameWorkView 的應用程式使用,以同步處理殼層繪製的 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()

取得執行中應用程式目前CoreWindowCoreWindowResizeManager實例。

NotifyLayoutCompleted()

通知父 CoreWindow 物件新版面配置已完成。

適用於