private void AddLobbyTab() { ClosableTab t = new ClosableTab(); t.Title = "Lobby"; t.Tag = null; t.CloseIsEnabled = false; ListBox tmp = new ListBox(); tmp.ItemTemplate = (DataTemplate)Application.Current.FindResource("ListBoxItemTemplate"); tmp.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch; t.Content = tmp; Tabs.Items.Add(t); Tabs.SelectedItem = t; tmp.ItemsSource = client.history; }
private void AddNewTab(Users user, bool isSelected) { ClosableTab t = new ClosableTab(); t.Title = user.user.username; t.Tag = user.user; ListBox tmp = new ListBox(); tmp.ItemTemplate = (DataTemplate)Application.Current.FindResource("ListBoxItemTemplate"); tmp.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch; t.Content = tmp; Tabs.Items.Add(t); tmp.ItemsSource = user.history; if (isSelected) { Tabs.SelectedItem = t; } }