private void ComponentLoad()
        {
            DynamicGrid dynamicGrid = new DynamicGrid(Enums.DynamicGridEnum.Custom, 30, 20, 20, 30)
            {
                VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand
            };

            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.Aqua, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand
            });
            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.Black, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand
            });
            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.Violet, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand
            });
            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.Yellow, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand
            });
            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.Aquamarine, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HeightRequest = 60
            });
            Content = dynamicGrid;
        }
Example #2
0
        public MainPage()
        {
            StackLayout sl          = new StackLayout();
            DynamicGrid dynamicGrid = new DynamicGrid(Enums.DynamicGridEnum.Custom, 20, 50, 20, 0);

            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.AliceBlue
            });
            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.Aqua
            });
            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.AntiqueWhite
            });
            dynamicGrid.AddView(new BoxView()
            {
                BackgroundColor = Color.Azure
            });
            sl.Children.Add(new PercentShowCardView(Color.Beige, Color.Bisque, 60, Color.Black, 90, 10));
            sl.Children.Add(dynamicGrid);
            Content = sl;
        }
        private View GetItem(ReportViewModel model)
        {
            StackLayout sl = new StackLayout()
            {
                Padding = 0, Margin = 0, Spacing = 0
            };
            DynamicGrid dynamicGrid = new DynamicGrid(DynamicGridEnum.Custom, 45, 55)
            {
                Padding = 0, HeightRequest = 20
            };

            dynamicGrid.AddView(new Label()
            {
                Text = $"{model.Name}", HorizontalTextAlignment = TextAlignment.Start, VerticalTextAlignment = TextAlignment.Center, TextColor = Color.Black, Margin = 0
            });
            dynamicGrid.AddView(new Label()
            {
                Text = $"{model.Value} TL", FontAttributes = FontAttributes.Bold, HorizontalTextAlignment = TextAlignment.Start, VerticalTextAlignment = TextAlignment.Center, Margin = 0, TextColor = Color.Black
            });
            sl.Children.Add(dynamicGrid);
            sl.Children.Add(new PercentShowCardView(Color.Green, Color.Red, model.Percent, Color.Black, 88, 12)
            {
                Margin = 0, Padding = 0
            });
            sl.Children.Add(new Line(LineEnum.Horizontal)
            {
                Margin = new Thickness(0, 10, 0, 0)
            });
            return(sl);
        }
Example #4
0
        private DynamicGrid GetFormContent()
        {
            DynamicGrid dynamicGrid = new DynamicGrid(Enums.DynamicGridEnum.Star, 2, 50)
            {
                ColumnSpacing = 5, RowSpacing = 5
            };

            dynamicGrid.AddView(new Entry()
            {
                Placeholder = "Ad-Soyad", ClassId = nameof(_model.Name)
            });
            dynamicGrid.AddView(new Entry()
            {
                Placeholder = "Telefon", ClassId = nameof(_model.Phone)
            });
            dynamicGrid.AddView(new Picker()
            {
                ItemsSource = new List <string>()
                {
                    "Malatya", "Istanbul"
                }, Title = "İl", ClassId = nameof(_model.City)
            });
            dynamicGrid.AddView(new Picker()
            {
                ItemsSource = new List <string>()
                {
                    "Babıhtı", "Çırmıhtı"
                }, Title = "İlçe", ClassId = nameof(_model.District)
            });
            return(dynamicGrid);
        }
        private void GridLoad()
        {
            DynamicGrid dynamicGrid = new DynamicGrid(2)
            {
                Margin = 5, ColumnSpacing = 5
            };

            dynamicGrid.AddView(PageLeft());
            dynamicGrid.AddView(PageRight());

            GridFrame.Content = dynamicGrid;
        }
Example #6
0
        private ScrollView GetTable()
        {
            ScrollView scrollView = new ScrollView()
            {
                Padding = 0, Margin = 0
            };
            StackLayout tablestack = new StackLayout()
            {
                Padding = 0, Margin = 0, Spacing = -2
            };

            foreach (var item in _wordList)
            {
                DynamicGrid dynamicGrid = new DynamicGrid(Xamarin.CustomViews.Enums.DynamicGridEnum.Custom, 20, 34, 40, 6)
                {
                    Padding = 0, Margin = 0, RowSpacing = 0, ColumnSpacing = 0
                };
                dynamicGrid.AddView(new Label()
                {
                    VerticalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, TextColor = TextExtensions.GetTextColor(item.Type), Text = item.Type.ToString(), Margin = 0
                });
                dynamicGrid.AddView(new Label()
                {
                    VerticalOptions = LayoutOptions.Center, Text = item.Key, TextColor = UserSettings.TextColor, Margin = new Thickness(5, 0, 0, 0)
                });
                dynamicGrid.AddView(new Label()
                {
                    HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, TextColor = UserSettings.TextColor, Text = item.Description, Margin = 0
                });

                dynamicGrid.AddView(new CircleImage()
                {
                    Source = "delete.png", GestureRecognizers = { new TapGestureRecognizer()
                                                                  {
                                                                      Command = new Command(DeleteButtonPressed), CommandParameter = item
                                                                  } }
                });
                tablestack.Children.Add(dynamicGrid);
                tablestack.Children.Add(new Line(LineEnum.Horizontal, UserSettings.MainColor)
                {
                    Margin = 0
                });
            }
            scrollView.Content = tablestack;
            return(scrollView);
        }