private void Engine_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { Markets.Clear(); foreach (var item in new MarketsRequest(Engine.Value).Response.Markets.Data.Select(d => new Item { Name = d["title"], Value = d["NAME"], Data = d } )) { Markets.Add(item); } Securities.Clear(); Boards.Clear(); Info = ""; History = new List <HistoryObject>(); FirePropertyChanged(nameof(Info)); FirePropertyChanged(nameof(History)); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } }
void Refresh() { try { Engines.Clear(); foreach (var item in new EnginesRequest().Response.Engines.Data.Select(d => new Item() { Name = d["title"], Value = d["name"], Data = d })) { Engines.Add(item); } Markets.Clear(); Securities.Clear(); Boards.Clear(); Info = ""; History = new List <HistoryObject>(); FirePropertyChanged(nameof(Info)); FirePropertyChanged(nameof(History)); } catch (Exception e) { MessageBox.Show(e.Message, "Error"); } }
private async void GetMarketList() { Markets.Clear(); var markets = await MarketService.GetMarket(); foreach (var marketName in MarketList) { Filtered = markets.Where(x => x.Name == marketName).FirstOrDefault(); FilteredMarkets.Add(Filtered); } Markets.AddRange(FilteredMarkets); FilteredMarkets.Clear(); }
private async Task GetMarketListCommand() { IsBusy = true; Markets.Clear(); var markets = await MarketService.GetMarket(); foreach (var marketName in MarketList) { Filtered = markets.Where(x => x.Name == marketName).FirstOrDefault(); FilteredMarkets.Add(Filtered); } Markets.AddRange(FilteredMarkets); FilteredMarkets.Clear(); IsBusy = false; }
public void Tick(float deltaTime) { if (!Dragging && _prevDragging && MarketsBuffer.Count > 1) { RoutePositions.Clear(); RoutePositions.AddRange(_routePositions); Markets.Clear(); Markets.AddRange(MarketsBuffer); } if (Dragging) { RebuildRoutePositions(); } UpdateHandle(); _prevDragging = Dragging; }