Example #1
0
        public static void Create(Canvas p, Thickness m)
        {
            if (sv != null)
            {
                sv.Show();
                ReSize(m);
                return;
            }
            task1 = load1 = false;
            WebClass.TaskGet("http://m.v.qq.com/index.html", (o) => {
                data1 = o;
                if (task1)
                {
                    ParseData.AnalyzeData(o.ToCharArray(), ref sv.area);
                    sv.Refresh();
                }
                else
                {
                    load1 = true;
                }
            });
            margin = m;
            sv     = new Scroll_ex();
#if desktop
            sv.maxcolumn = 5;
#else
            sv.maxcolumn = 4;
            sv.Lock      = MainEx.LockPivot;
            sv.UnLock    = MainEx.UnLockPivot;
#endif
            sv.UsingCustomTitle = true;
            sv.ForceUpdateOnce  = true;
            sv.area             = new Area_m[nav_all.Length];
            sv.ItemClick        = (o) => {
                if (o != null)
                {
                    VideoPage.SetAdress(o as string);
                    PageManageEx.CreateNewPage(PageTag.videopage);
                }
            };
            sv.PageClick = (o) => {
                PageAddress t = (PageAddress)o;
                if (t != PageAddress.None)
                {
                    PartialNav.LoadPage(t);
                    PageManageEx.CreateNewPage(PageTag.partial);
                }
            };
            for (int i = 0; i < nav_all.Length; i++)
            {
                int c = nav_all[i].count;
                sv.area[i].page  = nav_all[i].page;
                sv.area[i].title = nav_all[i].title;
                sv.area[i].count = c;
                sv.area[i].data  = new ItemData_m[c];
            }
            sv.ReSize(m);
            sv.SetParent(p);
            task1 = true;
            if (load1)
            {
                ParseData.AnalyzeData(data1.ToCharArray(), ref sv.area);
                sv.Refresh();
                load1 = false;
            }
        }