private void tvMusteriEkle_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var theCustomerAddTab = tabControl1.Items.OfType <CloseableTab.CloseableTab>().SingleOrDefault(x => x.Title == "Müşteri Ekle"); if (theCustomerAddTab != null) { theCustomerAddTab.Focus(); } else { CustomerAdd.CustomerAddUC customerAdd = new CustomerAdd.CustomerAddUC(); CloseableTab.CloseableTab theTabItem = new CloseableTab.CloseableTab(); theTabItem.Title = "Müşteri Ekle"; theTabItem.Content = customerAdd; tabControl1.Items.Add(theTabItem); theTabItem.Focus(); } }
private void btnMusteriDetay_Click(object sender, RoutedEventArgs e) { if (dgMusteriListesi.SelectedItem == null) { return; } if (MainScreenTabControl == null) { return; } SelectedCustomer = (CustomerContract)dgMusteriListesi.SelectedItem; CustomerAdd.CustomerAddUC customerAddUC = new CustomerAdd.CustomerAddUC(SelectedCustomer); CloseableTab.CloseableTab theTabItem = new CloseableTab.CloseableTab(); theTabItem.Title = $"Müşteri Detayları - ({SelectedCustomer.CustomerId}) {SelectedCustomer.CustomerName} {SelectedCustomer.CustomerLastName}"; theTabItem.Content = customerAddUC; MainScreenTabControl.Items.Add(theTabItem); theTabItem.Focus(); }