/// <summary> /// Clear fields and gets the fee for the selected pair /// </summary> private void OnPairChanged(PairSelected m) { if (m.SelectorType != SelectorType.Main) { return; } try { _selectedPair = m.Pair; lblItem1Balance.Text = lblItem2Balance.Text = string.Empty; txtBuyAmount.Text = txtBuyPrice.Text = txtSellAmount.Text = txtSellPrice.Text = string.Empty; var feeRes = _proxy.GetFee(m.Pair); lblCurrency1.Text = lblCurrency2.Text = m.Pair.Item2; lblSellAmountCurrency.Text = lblBuyAmountCurrency.Text = m.Pair.Item1; _fee = feeRes.Success ? feeRes.Result : new Fee { BuyFee = 0.5m, SellFee = 0.5m }; lblBuyFee.Text = lblSellFee.Text = "0"; lblBuyTotal.Text = lblSellTotal.Text = "0"; UpdateBalance(false); } catch (Exception ex) { Logger.Log(ex); ErrorHelper.DisplayErrorMessage(ex.ToString()); } }
/// <summary> /// Called when the main screen's pair changes /// </summary> /// <param name="message"></param> private void OnPairSelected(PairSelected message) { if (message.SelectorType == SelectorType.Main) { _selectedPair = message.Pair; dgvOpenOrders.Rows.Clear(); colAmount.HeaderText = message.Pair.Item1 + " Amount"; colPrice.HeaderText = "Price in " + message.Pair.Item2; colTotalPrice.HeaderText = "Total Price in " + message.Pair.Item2; RefreshOrders(false);//Auto refresh of open orders } }
private void PairsListView_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { PairSelected?.Invoke((PairVM)e.AddedItems[0]); }