@@ -37,5 +37,59 @@ public static void SetIsSelectedDataEnabled(DependencyObject obj, bool value)
3737 {
3838 obj . SetValue ( IsSelectedDataEnabledProperty , value ) ;
3939 }
40+
41+ /// <summary>
42+ /// The enable virtualization property
43+ /// </summary>
44+ public static readonly DependencyProperty EnableVirtualizationProperty =
45+ DependencyProperty . RegisterAttached ( "EnableVirtualization" , typeof ( bool ) , typeof ( ListBox ) ,
46+ new FrameworkPropertyMetadata ( false ) ) ;
47+
48+ /// <summary>
49+ /// Gets the enable virtualization.
50+ /// </summary>
51+ /// <param name="obj">The object.</param>
52+ /// <returns></returns>
53+ public static bool GetEnableVirtualization ( DependencyObject obj )
54+ {
55+ return ( bool ) obj . GetValue ( EnableVirtualizationProperty ) ;
56+ }
57+
58+ /// <summary>
59+ /// Sets the enable virtualization.
60+ /// </summary>
61+ /// <param name="obj">The object.</param>
62+ /// <param name="value">if set to <c>true</c> [value].</param>
63+ public static void SetEnableVirtualization ( DependencyObject obj , bool value )
64+ {
65+ obj . SetValue ( EnableVirtualizationProperty , value ) ;
66+ }
67+
68+ /// <summary>
69+ /// The virtualized cache maximum items property
70+ /// </summary>
71+ public static readonly DependencyProperty VirtualizedCacheMaxItemsProperty =
72+ DependencyProperty . RegisterAttached ( "VirtualizedCacheMaxItems" , typeof ( int ) , typeof ( ListBox ) ,
73+ new FrameworkPropertyMetadata ( 50 ) ) ;
74+
75+ /// <summary>
76+ /// Gets the virtualized cache maximum items.
77+ /// </summary>
78+ /// <param name="obj">The object.</param>
79+ /// <returns></returns>
80+ public static int GetVirtualizedCacheMaxItems ( DependencyObject obj )
81+ {
82+ return ( int ) obj . GetValue ( VirtualizedCacheMaxItemsProperty ) ;
83+ }
84+
85+ /// <summary>
86+ /// Sets the virtualized cache maximum items.
87+ /// </summary>
88+ /// <param name="obj">The object.</param>
89+ /// <param name="value">The value.</param>
90+ public static void SetVirtualizedCacheMaxItems ( DependencyObject obj , int value )
91+ {
92+ obj . SetValue ( VirtualizedCacheMaxItemsProperty , value ) ;
93+ }
4094 }
4195}
0 commit comments