Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public PricingView(PricingViewModel vm)
- {
- InitializeComponent();
- var dataView = new VirtualQueryableCollectionView()
- { LoadSize=20, VirtualItemCount = vm.Prices.Count };
- dataView.ItemsLoading += (sender, e) =>
- {
- var view = sender as VirtualQueryableCollectionView;
- if (dataView != null)
- {
- view.Load(e.StartIndex, vm.Prices.Skip(e.StartIndex).Take(e.ItemCount));
- }
- };
- this.PricesGridView.ItemsSource = dataView;
- }
- void MainViewModel()
- {
- this.Traces = new VirtualQueryableCollectionView<MyEntityClass>()
- {
- // ViewModel also manages the LoadSize
- LoadSize = this.PageSize,
- VirtualItemCount = myModel.TotalCount
- };
- this.Traces.ItemsLoading += (s, args) =>
- {
- this.Traces.Load(args.StartIndex,
- myModel.FetchRange(args.StartIndex, args.ItemCount));
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement