Пример #1
0
        public void setPicTransactionPage()
        {
            PicTransationPath PicTransation = new PicTransationPath();

            if (PicTransation.lstPicPath.Count <= 0)
            {
                return;
            }

            foreach (string strTemp in PicTransation.lstPicPath)
            {
                PicTransationControl newPage = new PicTransationControl();
                PicInfo PicTempInfo          = new PicInfo();
                PicTempInfo.nHeight    = 780;
                PicTempInfo.nWidth     = 1038;
                PicTempInfo.strImgLink = strTemp;
                newPage.DataContext    = PicTempInfo;
                myPicTransationPageQueue.Enqueue(newPage);
                currentPage = newPage;
            }

            //pageTransitionControl.ShowPage(currentPage);
            getThePicChangeTime();
            creatThePicChangeThread();
        }
        public ListBoxPicViewModel()
        {
            PathLists = new ObservableCollection <PicPathList>();

            RenJiCaoZuo.PicTransationPath PicTransation = new PicTransationPath();
            if (PicTransation.lstPicPath.Count <= 0)
            {
                return;
            }

            foreach (string strTemp in PicTransation.lstPicPath)
            {
                PicPathList PicTempInfo = new PicPathList();
                PicTempInfo.FilePath = strTemp;
                PathLists.Add(PicTempInfo);
            }
            string sRefreshTime = ConfigurationManager.AppSettings["Pic_ChangTime"];
            int    nRefreshTime = Convert.ToInt16(sRefreshTime);

            //Thread thread = new Thread(new ThreadStart(RefreshList));
            //thread.Start();

            ThreadPool.QueueUserWorkItem(new WaitCallback(RefreshList), nRefreshTime);
        }