Exemplo n.º 1
0
		private View createTopPanel ()
		{
			accountPicker = new Picker {
				Title = "Account",
				HorizontalOptions = LayoutOptions.StartAndExpand
			};
			accountPicker.SelectedIndexChanged += (object sender, EventArgs e) => {
				if (accountPicker.SelectedIndex > -1) {
					currentTradingAccount = tradingAccounts[accountPicker.SelectedIndex];
					tradingAPI.SendSubscribeForTradingEventsRequest (currentTradingAccount.AccountId);
					fillSymbols();
					tradingAPI.SendSubscribeForSpotsRequest (currentTradingAccount.AccountId, currentSymbol.SymbolName);
					refreshPlotView();
				}
			};

			StackLayout panel = new StackLayout {
				Spacing = 0,
				Orientation = StackOrientation.Horizontal,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				Children = {
					accountPicker
				}
			};
			return panel;
		}
Exemplo n.º 2
0
		private void fillAccounts ()
		{
			tradingAccounts = accountsAPI.getTradingAccounts();
			foreach (TradingAccountJson tradingAccount in tradingAccounts) {
				accountPicker.Items.Add (tradingAccount.Live ? "Live" : "Demo " + tradingAccount.AccountNumber + " - " + tradingAccount.BrokerTitle);
			}
			accountPicker.SelectedIndex = 0;
			currentTradingAccount = tradingAccounts[accountPicker.SelectedIndex];
		}