public UserControl1() { InitializeComponent(); DataContext = new ProcViewModel(); Grid.Sorting += Grid_Sorting; Timer timer = new Timer(5000); timer.Elapsed += Timer_Elapsed; timer.Start(); }
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { Application.Current.Dispatcher.Invoke(new Action(() => { DataContext = new ProcViewModel(sortIndex); })); Debug.WriteLine("Timer!"); }