Пример #1
0
 private void OnFilterRecordsTextChanged()
 {
     Dispatcher.UIThread.Post(() =>
     {
         _recordsFilter = _filterRecordsText?.Text;
         _recordsView?.Refresh();
     });
 }
Пример #2
0
        private void CreateRecordsView()
        {
            _recordsView        = new DataGridCollectionView(_database.Records);
            _recordsView.Filter = FilterRecords;
            _rowsDataGrid.Items = _recordsView;

            _recordsFilter = _filterRecordsText?.Text;
            _recordsView?.Refresh();
        }
        private void MainWindow_Tapped(object sender, Avalonia.Interactivity.RoutedEventArgs e)
        {
            for (int i = 0; i < 1; i++)
            {
                testItems.Add(new TestItem());
            }

            collectionView.Refresh();

            /*dataGrid.Measure(Bounds.Size);
             * Size desiredSize = grid.DesiredSize;
             * Size dataGridDesiredSize = dataGrid.DesiredSize;
             * grid.InvalidateMeasure();
             * grid.InvalidateArrange();
             * dataGrid.InvalidateMeasure();
             * dataGrid.InvalidateArrange();
             * InvalidateMeasure();
             * InvalidateArrange();*/
        }
Пример #4
0
        private void checkShowAll_Checked(object sender, RoutedEventArgs e)
        {
            var ch = sender as CheckBox;

            if (ch != null)
            {
                IsMeterNumbersMoreZeroOnly = ch.IsChecked.GetValueOrDefault();
                this.Dispatcher.BeginInvoke(new Action(delegate()
                {
                    if (_grid != null)
                    {
                        DataGridCollectionView collectionView = _grid.ItemsSource as DataGridCollectionView;
                        if (collectionView != null)
                        {
                            collectionView.Refresh();
                        }
                    }
                }), DispatcherPriority.ApplicationIdle);
            }
        }
Пример #5
0
        void WorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                Manager.UI.ShowMessage(e.Error.Message);

                //Это ошибка отменяем все запросы на сервере
                CancelWaitMonit();
            }
            else
            {
                //Если накопились на отмену - отменяем
                _waiterId = null;

                var ex = e.Result as Exception;
                if (ex != null)
                {
                    Manager.UI.ShowMessage(ex.Message);
                }

                _grid.AllowDetailToggle = true;

                //Обновляем view
                Dispatcher.BeginInvoke(new Action(delegate()
                {
                    if (_grid != null)
                    {
                        DataGridCollectionView collectionView = _grid.ItemsSource as DataGridCollectionView;
                        if (collectionView != null)
                        {
                            collectionView.Refresh();
                        }
                    }
                }), DispatcherPriority.ApplicationIdle);
            }

            progress.Abort();
            progress.IsEnabled = true;
        }
Пример #6
0
        private void ViewModelOnRefreshDataGridEvent(object sender, EventArgs eventArgs)
        {
            DataGridCollectionView lmCollectionView = this.LevelMappingDataGrid.ItemsSource as DataGridCollectionView;

            if (lmCollectionView != null)
            {
                lmCollectionView.Refresh();
            }

            DataGridCollectionView sslCollectionView = this.SpecialStagesLevelMappingDataGrid.ItemsSource as DataGridCollectionView;

            if (sslCollectionView != null)
            {
                sslCollectionView.Refresh();
            }

            DataGridCollectionView lgbCollectionView = this.LoadGameBoardsDataGrid.ItemsSource as DataGridCollectionView;

            if (lgbCollectionView != null)
            {
                lgbCollectionView.Refresh();
            }

            DataGridCollectionView lgbssCollectionView = this.LoadGameBoardsDataGridSpecialStages.ItemsSource as DataGridCollectionView;

            if (lgbssCollectionView != null)
            {
                lgbssCollectionView.Refresh();
            }

            DataGridCollectionView lgbalCollectionView = this.LoadGameBoardsDataGridArchivedLevels.ItemsSource as DataGridCollectionView;

            if (lgbalCollectionView != null)
            {
                lgbalCollectionView.Refresh();
            }
        }