private void SyncLogs(TraceLog log)
 {
     if (log != null)
     {
         TraceLogProvider.Instance().RaiseSyncTraceLogsUpdated(TabGuid, log.LogDateTime);
     }
 }
        public TraceViewerViewModel(int offset)
        {
            TabName = "Test Tab";
            TabGuid = Guid.NewGuid();

            SyncLogsCommand = new RelayCommand <TraceLog>(log => SyncLogs(log));

            GenerateTestLogs(500, offset);

            TraceLogProvider.Instance().OnSyncTraceLogsUpdated += SyncWithDateTimeInstance;
        }
        private async void SyncWithDateTimeInstance(SyncTraceLogsEventArgs syncTracesArgs)
        {
            if (syncTracesArgs != null)
            {
                if (TabGuid != syncTracesArgs.SenderTabGuid)
                {
                    var log = await Task.Run(() => TraceLogProvider.Instance().FindNearbyLog(Logs, syncTracesArgs.SyncDateTime));

                    if (log != null)
                    {
                        Log = null;
                        Log = log;
                    }
                }
            }
        }
        private async void SyncWithDateTimeInstance(SyncTraceLogsEventArgs syncTracesArgs)
        {
            TraceViewerViewModel currentVm;

            if (DataContext is TraceViewerViewModel && syncTracesArgs != null)
            {
                currentVm = DataContext as TraceViewerViewModel;

                if (currentVm.TabGuid != syncTracesArgs.SenderTabGuid)
                {
                    var log = await Task.Run(() => TraceLogProvider.Instance().FindNearbyLog(currentVm.Logs, syncTracesArgs.SyncDateTime));

                    if (log != null)
                    {
                        dgvLogs.ScrollIntoView(log);
                    }
                }
            }
        }