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); } } } }