public SampleViewModel(IDispatcherService dispatcherService, IGridPersistenceService persistenceService) { this.dispatcherService = dispatcherService; this.gridPersistenceService = persistenceService; SaveLayoutCommand = new TaskCommand <XamDataGrid>(OnSaveCommandExecute); LoadLayoutCommand = new TaskCommand <XamDataGrid>(OnLoadCommandExecute); dispatcherTimer.Interval = TimeSpan.FromMilliseconds(dispatcherInterval); dispatcherTimer.Tick += DispatcherTimer_Tick1; timer = new Timer(1000); timer.Elapsed += Timer_Elapsed; timer.Start(); DataItems = new FastObservableCollection <DealSpotVisual>(); lock (mappingDummyItemsLock) { mappingDummyItems = DataItems.ToDictionary(x => x.Id, x => x); } }