示例#1
0
        public static void CreatePivot(ref PivotPage pp, ref string[][] s)
        {
            Pivot p = new Pivot();

            pp.pivot = p;
            int l = s.Length;

            pp.items = new PivotItem[l];
            pp.son   = new Canvas[l];
            pp.head  = new Button[l];
            for (int i = 0; i < l; i++)
            {
                Button b = new Button();
                b.Content    = s[i][language];
                b.Foreground = nav_brush;
                b.Background = bk_brush;
                pp.head[i]   = b;
                Canvas can = new Canvas();
                can.Background = half_t_brush;
                pp.son[i]      = can;
                can.Margin     = new Thickness(-10, 0, 0, 0);
                PivotItem pi = new PivotItem();
                pi.Header   = b;
                pi.Content  = can;
                pp.items[i] = pi;
                p.Items.Add(pi);
            }
            pp.index = -1;
        }
示例#2
0
        public static void ResizePivot(ref PivotPage pp, Thickness m)
        {
            double h = m.Bottom - m.Top;
            Pivot  p = pp.pivot;

            p.Margin = m;
            p.Width  = screenX;
            p.Height = h;
            h       -= 30;
            if (pp.items == null)
            {
                return;
            }
            int l = pp.items.Length;

            //double sw = screenX / l - 6;
            for (int i = 0; i < l; i++)
            {
                //pp.head[i].Width = sw;
                pp.son[i].Width  = screenX;
                pp.son[i].Height = h;
            }
        }