Exemplo n.º 1
0
        /// <summary>
        /// 返回用户信息分页
        /// </summary>
        public void Login_DataPage()
        {
            LoginInfoModelList list = Get_LoginInfoList();
            PageGrid           pg   = new PageGrid();

            if (list != null)
            {
                pg.total    = list.logindatalist.Count;
                pg.current  = 1;
                pg.rowCount = list.logindatalist.Count;
                pg.rows     = list.logindatalist;
                CommonMethod.ResponseJsonResult(pg);
            }
            else
            {
                CommonMethod.ResponseJsonResult(pg);
            }
        }
Exemplo n.º 2
0
        public App()
        {
            InitializeComponent();

            MainPage = new PageGrid();
        }
Exemplo n.º 3
0
        public CarouselTable(TableArray tableArray)
        {
            this.Padding = 10;

            TableStack = new StackLayout
            {
                VerticalOptions   = LayoutOptions.StartAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding           = 0,
                Spacing           = 0,
                BackgroundColor   = Color.Gray.WithLuminosity(.9),
                Orientation       = StackOrientation.Vertical,
            };
            var headerStack = new StackLayout
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                Orientation       = StackOrientation.Horizontal,
                Padding           = 1,
                Spacing           = 4,
            };

            AI = new ActivityIndicator
            {
                IsRunning = true,
                IsVisible = true,
            };
            headerStack.Children.Add(AI);
            var headerLabel = new Label
            {
                VerticalOptions         = LayoutOptions.StartAndExpand,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalTextAlignment = TextAlignment.Center,
                Text           = tableArray.TableTitle,
                LineBreakMode  = LineBreakMode.TailTruncation,
                FontSize       = 14,
                HeightRequest  = 20,
                TextColor      = Color.Black.WithLuminosity(.25),
                FontAttributes = FontAttributes.Bold,
            };

            headerStack.Children.Add(headerLabel);
            TableStack.Children.Add(headerStack);
            VerticalScroll = new ScrollView
            {
                VerticalOptions   = LayoutOptions.StartAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                Padding           = 0,
                Orientation       = ScrollOrientation.Vertical,
            };
            TableStack.Children.Add(VerticalScroll);
            var tableBorder = new StackLayout
            {
                BackgroundColor   = Color.Gray.WithLuminosity(.6),
                Spacing           = 0,
                Padding           = .5,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.StartAndExpand,
            };

            tableBorder.Children.Add(TableStack);
            this.Content = tableBorder;
            pageGrid     = new PageGrid(tableArray, this);

            pageGrid.tableScroll.Scrolled += ((object sender, ScrolledEventArgs e) =>
            {
                if (IsBusy)
                {
                    return;
                }
                if (Math.Abs(e.ScrollX) < .001)
                {
                    SelectCircle(CircleLabels[0]);
                    return;
                }

                for (int i = 0; i < tableArray.TableData.GetUpperBound(0); i++)
                {
                    if (i % 2 == 0)
                    {
                        var l = pageGrid.tableGrid.Children[i].Bounds.Left;
                        var w = pageGrid.tableGrid.Children[i].Bounds.Right;
                        if (e.ScrollX >= l && e.ScrollX <= w)
                        {
                            SelectCircle(CircleLabels[i]);
                            return;
                        }
                    }
                }
            });

            SizeChanged += ((object sender, EventArgs e) =>
            {
                if ((sender as ContentView).Height > 0 && Math.Abs((sender as ContentView).Height - _height) > .001)
                {
                    this._width = (sender as ContentView).Width;
                    this._height = (sender as ContentView).Height;
                    if (SelectorStack == null)
                    {
                        DrawSelector(tableArray);

                        IsBusy = true;
                    }
                }
            });
        }