Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();

            //进行数据绑定
            dgv_ProcessList.ItemsSource = TaskManagerProcess.Update();

            _dispatcherTimer          = new DispatcherTimer();
            _dispatcherTimer.Tick    += new EventHandler(DispatcherTimer_Tick);
            _dispatcherTimer.Interval = new TimeSpan(0, 0, 10);
            _dispatcherTimer.Start();
        }
Exemple #2
0
        private void DispatcherTimer_Tick(object sender, EventArgs e)
        {
            //进行数据绑定
            dgv_ProcessList.ItemsSource = TaskManagerProcess.Update();

            if (_lastHeaderClicked != null)
            {
                if (_lastHeaderClicked.Role != GridViewColumnHeaderRole.Padding)
                {
                    string header = (_lastHeaderClicked.Column.DisplayMemberBinding as Binding).Path.Path;
                    Sort(header, _lastDirection);
                }
            }
        }