DeferRefresh() public méthode

public DeferRefresh ( ) : IDisposable
Résultat IDisposable
            public LapTimesViewModel(IFilter<LapTimeWrapped> filter) {
                _filter = filter;
                List = WrappedCollection.Create(LapTimesManager.Instance.Entries, x => new LapTimeWrapped(x));
                View = new ListCollectionView((IList)List);

                using (View.DeferRefresh()) {
                    if (_filter == null) {
                        View.Filter = null;
                    } else {
                        View.Filter = FilterTest;
                    }
                }
            }
Exemple #2
0
 private void BindListCollectionView()
 {
     QueryObject q = new QueryObject(null, new List<SortObject>(), 3, 0);
     int totalResults = -1;
     _sourceList = (IList)new Person().Get(q, out totalResults);
     ListCollectionView lcv = new ListCollectionView(_sourceList);
     using (IDisposable defer = lcv.DeferRefresh())
     {
         PeopleGrid.ItemsSource = lcv;
         lcv.SortDescriptions.Add(new SortDescription("Age", ListSortDirection.Descending));
         lcv.GroupDescriptions.Add(new PropertyGroupDescription("Country"));
     }
 }