private void AddButton_Click(object sender, RoutedEventArgs e) { var editComponent = new ElementEditComponent(); var newTab = new TabItem { Header = "Добавить Элемент", Content = editComponent }; ElementEditPanel_TabControl.Items.Add(newTab); }
public void EditElement(ElementViewModel elementViewModel) { var editComponent = new ElementEditComponent(elementViewModel); var newTab = new TabItem { Header = elementViewModel.Title.Value, Content = editComponent }; ElementEditPanel_TabControl.Items.Add(newTab); ElementEditPanel_TabControl.SelectedItem = ElementEditPanel_TabControl.Items.Count; }