VirtualizingLayoutContext.GetOrCreateElementAtCore 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
protected:
virtual UIElement ^ GetOrCreateElementAtCore(int index, ElementRealizationOptions options) = GetOrCreateElementAtCore;
UIElement GetOrCreateElementAtCore(int const& index, ElementRealizationOptions const& options);
protected virtual UIElement GetOrCreateElementAtCore(int index, ElementRealizationOptions options);
function getOrCreateElementAtCore(index, options)
Protected Overridable Function GetOrCreateElementAtCore (index As Integer, options As ElementRealizationOptions) As UIElement
參數
- options
- ElementRealizationOptions
指定是否要隱藏擷取項目的自動回收,還是強制建立新元素。
傳回
表示數據項的 UIElement 。
備註
GetOrCreateElementAt (System.Int32) 和 GetOrCreateElementAt (System.Int32,Microsoft.UI.Xaml.Controls.ElementRealizationOptions) 呼叫此方法。
當您要求指定索引的專案時,您可以選擇性地指定是否要隱藏擷取項目的自動回收,還是強制建立新元素。 自動回收所擷取的元素會隱藏 (SuppressAutoRecycle) 會被自動回收邏輯忽略,以清除未擷取為目前版面配置階段一部分的實現專案。 您必須將這些項目傳遞至 RecycleElementCore (Microsoft.UI.Xaml.UIElement) 方法來明確回收這些專案,以避免記憶體流失。
這些選項適用於更進階的配置,這些配置會選擇明確地管理元素的實現和回收作為效能優化。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應