예제 #1
0
        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;
        }
예제 #2
0
        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;
            }
        }