[原] XAF 如何使用Top

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;
        }
    }

 

你可能感兴趣的:([原] XAF 如何使用Top)