public void AddNewTab() { CloseableTab newTab = new CloseableTab(); SearchTasks nST = new SearchTasks(this); listTasks.Add(counterTasks++, nST); newTab.Content = nST; newTab.Title = "nouvelle recherche"; tabcontrol.Items.Insert(tabcontrol.Items.Count - 1, newTab); tabcontrol.SelectedIndex = tabcontrol.Items.Count-2; }
public MainWindow() { WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; InitializeComponent(); Application.Current.MainWindow.Closing += new CancelEventHandler(MainWindow_Closing); SearchTasks nST = new SearchTasks(this); listTasks.Add(counterTasks++, nST); tabtasks.Content = nST; SearchEvents nSE = new SearchEvents(this); listEvents.Add(counterEvents++, nSE); tabevents.Content = nSE; }