첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.

728x90
반응형
728x170

TestProject.zip
0.01MB

▶ StringCollection.cs

using System.Collections.ObjectModel;

namespace TestProject
{
    /// <summary>
    /// 문자열 컬렉션
    /// </summary>
    public class StringCollection : ObservableCollection<string>
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - StringCollection()

        /// <summary>
        /// 생성자
        /// </summary>
        public StringCollection()
        {
            for(int i = 0; i < 1000000; ++i)
            {
                Add("항목 " + i.ToString());
            }
        }

        #endregion
    }
}

 

728x90

 

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:TestProject"
    Width="800"
    Height="600"
    Title="VirtualizingStackPanel 클래스 : IsVirtualizing/VirtualizationMode 속성을 사용해 대용량 데이터 바인딩하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Window.Resources>
        <local:StringCollection x:Key="StringCollectionKey" />
    </Window.Resources>
    <Grid>
        <ListBox
            VirtualizingStackPanel.IsVirtualizing="True"
            VirtualizingStackPanel.VirtualizationMode="Recycling"
            ItemsSource="{StaticResource StringCollectionKey}" />
    </Grid>
</Window>
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요