.NET 學習

.NET 學習生活感想... 万事成蹉跎..... 贵在坚持 及时整理自己做过和学过的东西

博客园 首页 新随笔 联系 订阅 管理

1.代碼如下:

 

 public class S35430 : ViewController<ListView>
    {
        protected override void OnActivated()
        {
            base.OnActivated();
            CustomizeCollectionSource(View.CollectionSource);
            View.CollectionSource.CollectionChanged += new EventHandler(CollectionSource_CollectionChanged);
        }
        protected override void  OnDeactivated()
        {
            View.CollectionSource.CollectionChanged -= new EventHandler(CollectionSource_CollectionChanged);
              base.OnDeactivated();
        }
      
        private void CollectionSource_CollectionChanged(object sender, EventArgs e)
        {
            CustomizeCollectionSource((CollectionSourceBase)sender);
        }
        private static void CustomizeCollectionSource(CollectionSourceBase cs)
        {
            if (cs != null)
                cs.TopReturnedObjects = 5;
        }
    }

 

posted on 2012-07-04 09:25  Tonyyang  阅读(522)  评论(0编辑  收藏  举报
欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/