コード例 #1
0
        public FrequencyChooseControl(List <HDDCQKInfo> hDDCQKInfo)
        {
            InitializeComponent();
            infos = hDDCQKInfo;
            List <HDDCQKInfo> tempList = new List <HDDCQKInfo>();

            foreach (var temp in infos)
            {
                if (temp.IsCheck)
                {
                    tempList.Add(temp);
                }
            }
            var list = (from c in infos
                        where !(from d in tempList
                                select d.id).Contains(c.id)
                        select c
                        ).ToList();

            LoadPage.Text = "1";
            int count = list.Count() / 9;

            if (list.Count() % 9 != 0)
            {
                count++;
            }
            CountPage.Content = count.ToString();
            this.countPage    = count;
            if (count > 1)
            {
                int index = 8;
                while (index >= 0)
                {
                    ShowInfo.Add(list[8 - index]);
                    index--;
                }
            }
            else
            {
                countPage         = 1;
                CountPage.Content = 1.ToString();
                LoadPage.Text     = 1.ToString();
                foreach (var temp in list)
                {
                    ShowInfo.Add(temp);
                }
            }
            Bind.ItemsSource = tempList;
            grid.ItemsSource = ShowInfo;
            NBInfos          = list;
        }