void UpdateArea(ref Area ar) { List <ImageContext> lic = ar.context; int len = lic.Count; List <ItemModE> lim = ar.items; int c = lim.Count; ItemModE im; for (int i = 0; i < len; i++) { if (i >= c) { im = Component.CreateItemMod(); im.button.Click += (o, e) => { object ob = (o as Button).DataContext; if (ob != null) { VideoPage.SetAdress(o as string); PageManageEx.CreateNewPage(PageTag.videopage); } }; ar.can.Children.Add(im.can); lim.Add(im); } im = lim[i]; ImageContext ic = lic[i]; if (ic.src == null) { break; } (im.img.Source as BitmapImage).UriSource = new Uri(ic.src); im.button.DataContext = ic.href; if (ic.title == null) { im.title.Text = ""; } else { im.title.Text = ic.title; } if (!ar.expand) { im.can.Visibility = Visibility.Collapsed; } } for (int i = c - 1; i >= len; i--) { im = lim[i]; lim.RemoveAt(i); //ReCycleItemMod(im.index); } }
public static void Create(Canvas p, Thickness m) { if (tb != null) { ReSize(m); return; } double w = m.Right - m.Left; tb = new TextBox(); tb.KeyDown += s_keydown; tb.Width = w - 30; p.Children.Add(tb); ok = new SymbolIcon(); ok.Symbol = Symbol.Find; Thickness tk = new Thickness(); tk.Left = w - 30; tk.Right = w; ok.Margin = tk; ok.PointerReleased += (s, e) => { Find(); }; p.Children.Add(ok); m.Top += 40; m.Right -= 4; m.Bottom -= 10; sv = new Scroll_S(); sv.SetParent(p); sv.ReSize(m); sv.Getmore = () => { loading = true; index += 15; part++; Find(); }; sv.itemclick = (o) => { VideoPage.SetAdress(o as string); PageManageEx.CreateNewPage(PageTag.videopage); }; #if desktop sv.ShowBorder(); #endif }
public static void Create(Canvas p, Thickness m)//parent,margin { margin = m; if (svb != null) { nb.can.Visibility = Visibility.Visible; nb.show_filter = false; SettingChanged(); ReSize(m); return; } load = false; create = false; SetNav(0); parent = p; svb = new ScrollViewB(); svb.itemclick = (o) => { if (o != null) { VideoPage.SetAdress(o as string); PageManageEx.CreateNewPage(PageTag.videopage); } }; lid = svb.data; svb.SetParent(p); svb.ReSize(m); #if desktop svb.ShowBorder(); #endif buff_fid = new FilterItemData[8]; create = true; if (load) { Analyze(); } CreateNavBar(); ReSize(m); }
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; } }