private void LoadFile(string filename) { SpellHelper sh = SpellHelper.Load(filename); pnMapper.Children.Clear(); textBox1.Text = string.Concat((char) sh.BaseValue[0]); textBox2.Text = string.Concat((char) sh.BaseValue[1]); textBox3.Text = string.Concat((char) sh.BaseValue[2]); textBox4.Text = string.Concat((char) sh.BaseValue[3]); textBox5.Text = string.Concat((char) sh.BaseValue[4]); textBox6.Text = string.Concat((char) sh.BaseValue[5]); textBox7.Text = string.Concat((char) sh.BaseValue[6]); textBox8.Text = string.Concat((char) sh.BaseValue[7]); foreach (var b in sh.Binding) { var m = new Mapping(); m.Value = string.Concat((char) b.BindedKey); for (int i = 0; i < 10; i++) { m.SetMap(i, b.BindedValue[i]); } pnMapper.Children.Add(m); m.Bindwindow(this); } }
private void button1_Click(object sender, RoutedEventArgs e) { var m = new Mapping(); pnMapper.Children.Add(m); m.Bindwindow(this); m.Focus(); m.Select(); }