public void GenerateCurrencyControls(string currency, string value, int count) { RowDefinition gridRow1 = new RowDefinition(); gridRow1.Height = new GridLength(25); GridCurrencies.RowDefinitions.Add(gridRow1); System.Windows.Controls.Label lblMax = new System.Windows.Controls.Label(); lblMax.Content = "Max Trades for " + currency; Grid.SetRow(lblMax, count); Grid.SetColumn(lblMax, 0); GridCurrencies.Children.Add(lblMax); System.Windows.Controls.TextBox txtNumber = new System.Windows.Controls.TextBox(); txtNumber.Name = "txtCurrencyVal" + currency; txtNumber.VerticalAlignment = VerticalAlignment.Top; txtNumber.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; txtNumber.Text = value; txtNumber.Width = 20; Grid.SetRow(txtNumber, count); Grid.SetColumn(txtNumber, 1); GridCurrencies.Children.Add(txtNumber); if (GridCurrencies.FindName(txtNumber.Name) == null) { GridCurrencies.RegisterName(txtNumber.Name, txtNumber); } System.Windows.Controls.Button btnClickMe = new System.Windows.Controls.Button(); btnClickMe.Content = "Reset"; btnClickMe.VerticalAlignment = VerticalAlignment.Top; btnClickMe.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; btnClickMe.Name = "btnSet" + currency; btnClickMe.Click += new RoutedEventHandler(this.CallMeClick); Grid.SetRow(btnClickMe, count); Grid.SetColumn(btnClickMe, 3); GridCurrencies.Children.Add(btnClickMe); }
public void GenerateAddCurrencyControls(int count) { RowDefinition gridRow1 = new RowDefinition(); gridRow1.Height = new GridLength(25); GridCurrencies.RowDefinitions.Add(gridRow1); System.Windows.Controls.Label lblMax = new System.Windows.Controls.Label(); lblMax.Content = "Add Currency:"; Grid.SetRow(lblMax, count); Grid.SetColumn(lblMax, 0); GridCurrencies.Children.Add(lblMax); System.Windows.Controls.TextBox txtCurrency = new System.Windows.Controls.TextBox(); txtCurrency.Name = "txtCurrencyNew"; txtCurrency.VerticalAlignment = VerticalAlignment.Top; txtCurrency.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; txtCurrency.Width = 30; Grid.SetRow(txtCurrency, count); Grid.SetColumn(txtCurrency, 1); GridCurrencies.Children.Add(txtCurrency); if (GridCurrencies.FindName(txtCurrency.Name) == null) { GridCurrencies.RegisterName(txtCurrency.Name, txtCurrency); } System.Windows.Controls.Label lblMaxVal = new System.Windows.Controls.Label(); lblMaxVal.Content = "Max:"; lblMaxVal.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; Grid.SetRow(lblMaxVal, count); Grid.SetColumn(lblMaxVal, 2); GridCurrencies.Children.Add(lblMaxVal); System.Windows.Controls.TextBox txtValue = new System.Windows.Controls.TextBox(); txtValue.Name = "txtCurrencyNewValue"; txtValue.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; txtValue.VerticalAlignment = VerticalAlignment.Top; txtValue.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; txtValue.Width = 20; Grid.SetRow(txtValue, count); Grid.SetColumn(txtValue, 3); GridCurrencies.Children.Add(txtValue); if (GridCurrencies.FindName(txtValue.Name) == null) { GridCurrencies.RegisterName(txtValue.Name, txtValue); } System.Windows.Controls.Button btnClickMe = new System.Windows.Controls.Button(); btnClickMe.Content = "Set"; btnClickMe.VerticalAlignment = VerticalAlignment.Top; btnClickMe.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; btnClickMe.Name = "btnSetNew"; btnClickMe.Click += new RoutedEventHandler(this.NewCurrencySettingClick); Grid.SetRow(btnClickMe, count); Grid.SetColumn(btnClickMe, 4); GridCurrencies.Children.Add(btnClickMe); }