private void bmiCadastroPessoaClick() { BaseLayout objParent = this.Parent as BaseLayout; BaseBody baseBody = null; foreach (object item in objParent.Children) { Type type = item.GetType(); if (type.Name.Equals("BaseBody")) { baseBody = item as BaseBody; baseBody.Children.Clear(); CadastroPessoaView cpv = new CadastroPessoaView(); Grid.SetColumn(cpv, 1); baseBody.Children.Add(cpv); break; } } }
public void addChildren(ref BaseBody body, int?intX = null, int?intY = null) { try { if (!intX.Equals(null)) { Grid.SetColumn(body, Convert.ToInt32(intX)); } if (!intY.Equals(null)) { Grid.SetRow(body, Convert.ToInt32(intY)); } this.Children.Add(body); } catch (Exception ex) { throw ex; } }
public void changeBody(ref BaseBody body) { this.Children.Remove(this.FindName("BaseBodyGrid") as UIElement); this.addChildren(ref body, null, 1); }