Beispiel #1
0
        private void ListBox_CustomStr_Refresh()
        {
            CustomStrTab selectedItem = (CustomStrTab)Combo_CustomStrTab.SelectedItem;

            if (selectedItem is null)
            {
                return;
            }
            List <CustomStrData> SelectedList = selectedItem.StrList;
            int newCount = SelectedList.Count;
            int oldCount = CustomStrDisplayList.Count;

            if (newCount > oldCount)
            {
                for (int i = 0; i < newCount - oldCount; i++)
                {
                    CustomStrDisplayList.Add(new ListBoxItem_CustomStr(null, ConnectionTabHelper));
                }
            }
            else if (newCount < oldCount)
            {
                for (int i = 0; i < oldCount - newCount; i++)
                {
                    CustomStrDisplayList.RemoveAt(oldCount - 1 - i);
                }
            }
            for (int index = 0; index < newCount; index++)
            {
                CustomStrDisplayList.ElementAt(index).Data = SelectedList.ElementAt(index);
            }
            this.ListBox_CustomStr.ItemsSource = null;
            this.ListBox_CustomStr.ItemsSource = CustomStrDisplayList;
        }
Beispiel #2
0
        public void CustomStrTabRefresh()
        {
            CustomStrTab selectedItem = (CustomStrTab)Combo_CustomStrTab.SelectedItem;

            this.Combo_CustomStrTab.ItemsSource = null;
            this.Combo_CustomStrTab.ItemsSource = customStrManager.CustomStrTabList;

            if (customStrManager.CustomStrTabList.IndexOf(selectedItem) != -1)
            {
                this.Combo_CustomStrTab.SelectedItem = selectedItem;
            }
            else
            {
                this.Combo_CustomStrTab.SelectedIndex = 0;
            }
        }
Beispiel #3
0
 public TabItemModel(CustomStrTab tab)
 {
     Data = tab;
 }