public ApplicationSettings() { ServerUrl = "https://ciapipreprod.cityindextest9.co.uk/tradingapi"; StreamingServerUrl = "https://pushpreprod.cityindextest9.co.uk/CITYINDEXSTREAMING"; UserName = "******"; Password = "******"; NewsMaxCount = 30; NewsCategory = "NEWS.MOCKHEADLINES.UK"; GraphPeriodSecs = 300; PricesToWatch = new ApiMarketDTO[0]; }
private void ImageAdd_Click(object sender, MouseButtonEventArgs e) { var items = AllMarketsGrid.SelectedItems; foreach (ApiMarketDTO market in items) { var newSubscription = new ApiMarketDTO { MarketId = market.MarketId, Name = market.Name }; for (var i = 0; i < _subscriptions.Count; i++) { var cur = _subscriptions[i]; if (cur.MarketId == newSubscription.MarketId) { _subscriptions.RemoveAt(i); break; } } _subscriptions.Add(newSubscription); } }
private void RefreshMarketsView(ApiMarketDTO[] markets) { _marketsView = CollectionViewSource.GetDefaultView(markets); AllMarketsGrid.ItemsSource = _marketsView; _subscriptions.Clear(); foreach (var market in ApplicationSettings.Instance.PricesToWatch) { _subscriptions.Add(market); } SubscriptionsGrid.ItemsSource = _subscriptions; _subscriptions.CollectionChanged += SubscriptionsCollectionChanged; }