static void CreatePage(SwapChain p, RawRectangleF m) { if (panel == null) { panel = new UIViewPort(); } parent = p; lep = new List <FilterOption>(); videolist = new StackPanel(); videolist.ItemTemplate = DataModA.CreateDataMod(); videolist.BorderColor = new RawColor4(0f, 0f, 0f, 1); videolist.ItemClick = videolist.SelectChanged = (v) => { var sp = v as StackPanel; int c = sp.SelectedIndex; PlayControl((sp.Data[c] as DataModA).vid); }; CreateInfoPanel(); Resize(m); lock (p.DX_Child) p.DX_Child.Add(videolist); }
static void CreateAbout(SwapChain p) { if (about != null) { about.Visble = true; return; } about = new UIViewPort(); about.Size = new Size2F(240, 240); about.GaussianBack = true; about.Background = new RawColor4(0f, 0.1f, 0.2f, 0.4f); declare = new TextBlock(); declare.Alignment = SharpDX.DirectWrite.TextAlignment.Center; declare.Size = new Size2F(232, 232); declare.Location = new Vector2(3, 3); declare.Text = aouth; declare.Forground = new RawColor4(1, 1, 1, 1); declare.EventCross = true; //about.DX_Child.Add(declare); close = new TextBlock(); close.FontStyle = TextBlock.FontName.SegoeUISymbol; close.Text = ((char)0xe0a4).ToString(); close.SurfaceBrush = BrushManage.GetRadia_A(); close.Size = new Size2F(20, 20); close.Alignment = SharpDX.DirectWrite.TextAlignment.Center; close.PointerEntry = (o, e) => { close.SurfaceBrush = BrushManage.GetRadia_R(); ThreadManage.UpdateUI = true; }; close.PointerLeave = PointerLeave; close.Location = new Vector2(217, 3); about.DX_Child.Add(close); UIElement.SetClick(close, (o) => { about.Visble = false; declare.Visble = false; ThreadManage.UpdateUI = true; }); lock (p.DX_Child) { p.DX_Child.Add(about); p.DX_Child.Add(declare); } }
public static void Create(SwapChain p, RawRectangleF m)//parent,margin { if (sp != null) { ReSize(m); return; } SetNav(0); Parent = p; nav = new ListBox(); nav.Hrizon = true; int c = nav_data.Length; for (int i = 0; i < c; i++) { nav.Data.Add(nav_data[i].title[0]); } nav.SelectedIndex = 0; nav.ItemWidth = 60; nav.Forground = new RawColor4(0.8f, 0.8f, 0.8f, 1); nav.BorderColor = new RawColor4(0, 0, 0, 1); nav.Background = new RawColor4(0.6f, 0.4725f, 0.4725f, 0.8f); RoundBorder rb = new RoundBorder(); rb.RoundRect.RadiusX = 8; rb.RoundRect.RadiusY = 8; rb.Size = new Size2F(60, 20); rb.FillBrush = BrushManage.GetLinearA(); nav.FillTemplate = rb; nav.SelectChanged = (o) => { var lb = o as ListBox; if (lb.SelectedIndex < 0) { return; } if (lb.SelectedIndex >= 12) { return; } FilterPanel.Visble = false; for (int ss = 0; ss < sp.Data.Count; ss++) { (sp.Data[ss] as IDisposable).Dispose(); } sp.Data.Clear(); part = 0; TextBar[1].Text = "1"; SetNav(lb.SelectedIndex); }; nav.ItemClick = (o) => { ShowOrHideFilter(); }; FilterPanel = new UIViewPort(); FilterPanel.Visble = false; FilterPanel.GaussianBack = true; FilterPanel.Background = new RawColor4(0, 0.1f, 0.2f, 0.4f); sp = new GridPanel(); sp.ItemTemplate = DataMod.GetTemplate(); sp.BorderColor = new RawColor4(0, 0, 0, 1); create = true; sp.ItemClick = (o, e) => { if (sp.ClickIndex < 0) { return; } string href = (sp.Data[sp.ClickIndex] as DataMod).href; if (href != null) { VideoPage.SetAddress(href); } PageManageEx.CreateNewPage(PageTag.videopage); }; lock (p.DX_Child) { p.DX_Child.Add(sp); p.DX_Child.Add(nav); p.DX_Child.Add(FilterPanel); } CreateBar(p); ReSize(m); if (load) { Analyze(); } }