public async Task GetTrades() { // Account trades List <TTTrade> trades = null; if (string.IsNullOrEmpty(TradeId)) { trades = await _client.GetAllTradesAsync(); } else { long tradeId; if (long.TryParse(TradeId, out tradeId)) { try { TTTrade trade = await _client.GetTradeAsync(tradeId); trades = new List <TTTrade>(new[] { trade }); } catch (Exception) { } } } Trades = trades != null ? new ObservableCollection <TTTrade>(trades) : null; }