public Task TraceAsync(string data, DataOperation operation) { return(App.Current.Dispatcher.InvokeAsync(() => { if (!string.IsNullOrWhiteSpace(data)) { DataLenght += data.Length; var json = JObject.Parse(data); json.ToString(Formatting.Indented); var traceData = new TraceDataViewModel() { Operation = operation, Data = json.ToString() }; TraceLogs.Add(traceData); while (TraceLogs.Count > TraceLimit) { TraceLogs.RemoveAt(0); } } }).Task); }
public Task TraceAsync(string data, DataOperation operation) { return App.Current.Dispatcher.InvokeAsync(() => { if (!string.IsNullOrWhiteSpace(data)) { DataLenght += data.Length; var json = JObject.Parse(data); json.ToString(Formatting.Indented); var traceData = new TraceDataViewModel() { Operation = operation, Data = json.ToString() }; TraceLogs.Add(traceData); while (TraceLogs.Count > TraceLimit) { TraceLogs.RemoveAt(0); } } }).Task; }