void tmp_ValueChanged(object sender, int e) { EvoPreselection tmp = sender as EvoPreselection; string title = tmp.Text; if (title.StartsWith("Volume")) { MessageBox.Show("this is Volume!!!"); _preVolume = (e < 3 ? (byte)e : (byte)(e - 3 + 0x80)); } else if (title.StartsWith("Strength")) { MessageBox.Show("this is Strength!!!"); _preStrength = (e < 3 ? (byte)e : (byte)(e - 3 + 0x80)); } else if (title.StartsWith("Milk")) { MessageBox.Show("this is Milk!!!"); _preMilk = (e < 3 ? (byte)e : (byte)(e - 3 + 0x80)); } else if (title.StartsWith("Sugar")) { MessageBox.Show("this is Sugar!!!"); _preSugar = (e < 3 ? (byte)e : (byte)(e - 3 + 0x80)); } }
private void InitpreUi(RecipeInfo a) { _preVolume = 0x80; _preStrength = 0x80; _preMilk = 0x80; _preSugar = 0x80; grd_fun.Children.Clear(); grd_fun.RowDefinitions.Clear(); EvoPreselection tmp; tb_cups.Text = _cupcnt.ToString(); int grdrowindex = 0; if (a._publicInfo.setCups == 1) { grd_cup.Visibility = System.Windows.Visibility.Visible; } else { grd_cup.Visibility = System.Windows.Visibility.Hidden; } if (a._publicInfo.setVolume == 1) { grd_fun.RowDefinitions.Add(new RowDefinition()); tmp = new EvoPreselection(); tmp.SetValue(Grid.RowProperty, grdrowindex); tmp.Margin = new Thickness(0, 5, 0, 5); tmp.Text = "Volume."; tmp.ValueChanged += tmp_ValueChanged; grd_fun.Children.Add(tmp); grdrowindex++; } if (a._publicInfo.setStrength == 1) { grd_fun.RowDefinitions.Add(new RowDefinition()); tmp = new EvoPreselection(); tmp.SetValue(Grid.RowProperty, grdrowindex); tmp.Margin = new Thickness(0, 5, 0, 5); tmp.Text = "Strength."; tmp.ValueChanged += tmp_ValueChanged; grd_fun.Children.Add(tmp); grdrowindex++; } if (a._publicInfo.setMilk == 1) { grd_fun.RowDefinitions.Add(new RowDefinition()); tmp = new EvoPreselection(); tmp.SetValue(Grid.RowProperty, grdrowindex); tmp.Margin = new Thickness(0, 5, 0, 5); tmp.Text = "Milk."; tmp.ValueChanged += tmp_ValueChanged; grd_fun.Children.Add(tmp); grdrowindex++; } if (a._publicInfo.setSugar == 1) { grd_fun.RowDefinitions.Add(new RowDefinition()); tmp = new EvoPreselection(); tmp.SetValue(Grid.RowProperty, grdrowindex); tmp.Margin = new Thickness(0, 5, 0, 5); tmp.Text = "Sugar."; tmp.ValueChanged += tmp_ValueChanged; grd_fun.Children.Add(tmp); grdrowindex++; } }
private void InitpreUi(RecipeInfo a) { _preVolume = 0x80; _preStrength = 0x80; _preMilk = 0x80; _preSugar = 0x80; grd_fun.Children.Clear(); grd_fun.RowDefinitions.Clear(); EvoPreselection tmp; tb_cups.Text = _cupcnt.ToString(); int grdrowindex = 0; if (a._publicInfo.setCups == 1) { grd_cup.Visibility = System.Windows.Visibility.Visible; } else { grd_cup.Visibility = System.Windows.Visibility.Hidden; } if (a._publicInfo.setVolume ==1) { grd_fun.RowDefinitions.Add(new RowDefinition()); tmp = new EvoPreselection(); tmp.SetValue(Grid.RowProperty, grdrowindex); tmp.Margin = new Thickness(0, 5, 0, 5); tmp.Text = "Volume."; tmp.ValueChanged += tmp_ValueChanged; grd_fun.Children.Add(tmp); grdrowindex++; } if (a._publicInfo.setStrength == 1) { grd_fun.RowDefinitions.Add(new RowDefinition()); tmp = new EvoPreselection(); tmp.SetValue(Grid.RowProperty, grdrowindex); tmp.Margin = new Thickness(0, 5,0,5); tmp.Text = "Strength."; tmp.ValueChanged += tmp_ValueChanged; grd_fun.Children.Add(tmp); grdrowindex++; } if (a._publicInfo.setMilk == 1) { grd_fun.RowDefinitions.Add(new RowDefinition()); tmp = new EvoPreselection(); tmp.SetValue(Grid.RowProperty, grdrowindex); tmp.Margin = new Thickness(0, 5, 0, 5); tmp.Text = "Milk."; tmp.ValueChanged += tmp_ValueChanged; grd_fun.Children.Add(tmp); grdrowindex++; } if (a._publicInfo.setSugar == 1) { grd_fun.RowDefinitions.Add(new RowDefinition()); tmp = new EvoPreselection(); tmp.SetValue(Grid.RowProperty, grdrowindex); tmp.Margin = new Thickness(0, 5, 0, 5); tmp.Text = "Sugar."; tmp.ValueChanged += tmp_ValueChanged; grd_fun.Children.Add(tmp); grdrowindex++; } }