VirtualizingStackPanel.SetIsVirtualizing(DependencyObject, Boolean) 方法

定義

設定 IsVirtualizingProperty 附加屬性的值。

public:
 static void SetIsVirtualizing(System::Windows::DependencyObject ^ element, bool value);
public static void SetIsVirtualizing (System.Windows.DependencyObject element, bool value);
static member SetIsVirtualizing : System.Windows.DependencyObject * bool -> unit
Public Shared Sub SetIsVirtualizing (element As DependencyObject, value As Boolean)

參數

element
DependencyObject

要在其中設定附加屬性值的物件。

value
Boolean

如果 VirtualizingStackPanel 正在虛擬化,則為 true,否則為 false

備註

標準版面配置系統會為與清單控制項相關聯的每個專案建立專案容器和計算版面配置。 「虛擬化」這個字是指一種技術,其中 UI 元素的子集是根據螢幕上可見的專案,從較大的資料項目產生。 當只有少數元素可能在螢幕上時產生許多 UI 元素,可能會對應用程式的效能造成負面影響。 會 VirtualizingStackPanel 計算可見專案的數目,並使用 ItemContainerGenerator ItemsControl (,例如 ListBoxListView) ,以便只針對可見專案建立 UI 元素。

適用於