当前位置: 代码迷 >> Silverlight >> ObservableCollection.Insert 速度很慢解决办法
  详细解决方案

ObservableCollection.Insert 速度很慢解决办法

热度:2154   发布时间:2013-02-26 00:00:00.0
ObservableCollection.Insert 速度很慢
如题,有没有什么办法可以解决?
加的数据越多,就会越慢。

  //定义的数据类型
    public class RowData : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        protected void OnPorpertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        private ObservableCollection<string> dataArray;
        public ObservableCollection<string> RowDataArray
        {
            get { return dataArray; }
            set
            {
                if (dataArray != value)
                {
                    dataArray = value;
                    OnPorpertyChanged("RowDataArray");
                }
            }
        }

        private string rowTitle;
        public string RowHeader
        {
            get { return rowTitle; }
            set
            {
                if (value != rowTitle)
                {
                    rowTitle = value;
                    OnPorpertyChanged("RowHeader");
                }
            }
        }

        private ObservableCollection<string> foregroundArray;
        public ObservableCollection<string> ForegroundArray
        {
            get { return foregroundArray; }
  相关解决方案