Пример #1
0
        public void AddItemsToGrid()
        {
            parent.Children.Clear();


            #region Header

            //parent.Children.Add(new Label { Text = "\u2713", HorizontalOptions = LayoutOptions.Start, HorizontalTextAlignment = TextAlignment.Start, Opacity =  0 },0,0);
            //parent.Children.Add(new Label { Text = "Image", HorizontalOptions = LayoutOptions.Start, HorizontalTextAlignment = TextAlignment.Start, Opacity = 0 }, 1, 0);
            //parent.Children.Add(new Label { Text = "Text", HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Start }, 2, 0);
            //parent.Children.Add(new Label { Text = "Body", HorizontalOptions = LayoutOptions.End, HorizontalTextAlignment = TextAlignment.End }, 3, 0);

            #endregion

            int start = pageIndex * PickerItem;
            int end   = Math.Min(start + PickerItem, stands.Count);

            for (int y = start; y < end; y++)
            {
                stands[y].AddRow(parent, y - start);
            }

            int secItem    = int.Parse(picker.Items[1]);
            int difference = end - start;

            if (difference < secItem)
            {
                for (int y = difference; y < secItem; y++)
                {
                    Stand.AddEmptyRow(parent, y);
                }
            }
        }
Пример #2
0
        public void CheckCode(string result)
        {
            editPass.Text = string.Empty;

            if (!stands.Exists(x => x.Pass == result.ToLower()))
            {
                DisplayAlert("Chyba", "Tento kód není platný", "Ok");
                return;
            }
            Stand stand = stands.First(x => x.Pass == result);

            if (stand.Visited)
            {
                DisplayAlert(" ", "Tento kód jste již zadali", "Ok");
                return;
            }
            stand.Visited = true;

            Settings.Stands += Settings.CurrentEvent.Id + "." + stands.IndexOf(stand) + ";";
            if (!stands.Exists(x => !x.Visited))
            {
                BtnSubmit_Clicked(null, null);
            }
            Show();
        }