Beispiel #1
0
 public static IObservable <IEvent <QueryItemsEventArgs> > GetQueryItems(
     this DataGridVirtualizingCollectionView view)
 {
     return
         (Observable.FromEvent((EventHandler <QueryItemsEventArgs> h) => new EventHandler <QueryItemsEventArgs>(h),
                               h => { view.QueryItems += h; Debug.WriteLine("   -> Attached: " + h); },
                               h => { view.QueryItems -= h; Debug.WriteLine("   -> DeAttached: " + h); }));
 }
Beispiel #2
0
        public XceedDataGrid()
        {
            InitializeComponent();
            Loaded       += new RoutedEventHandler(XceedDataGrid_Loaded);
            _ModelColView = new DataGridVirtualizingCollectionView(typeof(Product));

            var queryItems     = _ModelColView.GetQueryItems();
            var queryItemCount = _ModelColView.GetQueryItemCount().SkipUntil(queryItems);

            queryItemCount.Subscribe(v =>
            {
                v.EventArgs.Count = 1;
            });
            queryItems.Subscribe(v => v.EventArgs.AsyncQueryInfo.EndQuery(new[] { new Product()
                                                                                  {
                                                                                      Description = "aaa"
                                                                                  } }));
        }
Beispiel #3
0
        public XceedTestViewModel(IAccountBalanceDataService dataService)
        {
            Accounts = dataService.AccountPeople;

            _objects = new List <TestViewModel>();
            for (var i = 0; i < 200; i++)
            {
                _objects.Add(new TestViewModel {
                    Id = i, Name = "test", AccountBalance = 1000 * i
                });
            }

            ViewSource                 = new DataGridVirtualizingCollectionView(typeof(AccountPeopleSelector), false, 50, 1000);
            ViewSource.QueryItems     += ViewSourceOnQueryItems;
            ViewSource.QueryItemCount += ViewSourceOnQueryItemCount;

            Accounts.Subscribe(update =>
            {
                if (update.IsRowUpdate())
                {
                    ViewSource.Refresh();
                }
            });
        }
 internal DataGridVirtualizingCollectionViewGroupRoot(DataGridVirtualizingCollectionView collectionView, bool isBottomLevel)
     : base(null, -1, 0, null, -1, isBottomLevel)
 {
     m_parentCollectionView = collectionView;
     m_virtualPageManager   = new DataGridPageManager(collectionView);
 }