private void ListTemplate() { AssList.ItemSpacing = 0; AssList.AutoFitMode = Syncfusion.ListView.XForms.AutoFitMode.DynamicHeight; AssList.BindingContext = new Assignments(); AssList.ItemTemplate = new DataTemplate(() => { Grid MainGrid = new Grid() { VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.FromRgba(0, 0, 0, 0.5), Margin = new Thickness(0), Padding = 0 }; StackLayout main = new StackLayout() { Spacing = 5, Margin = 0, Padding = 0, Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; StackLayout firstRow = new StackLayout() { Orientation = StackOrientation.Horizontal, Spacing = 0, VerticalOptions = LayoutOptions.Fill, HorizontalOptions = LayoutOptions.FillAndExpand, HeightRequest = 50 }; Label l = new Label() { TextColor = Color.White, FontSize = 18, WidthRequest = 200, LineBreakMode = Xamarin.Forms.LineBreakMode.TailTruncation, FontAttributes = FontAttributes.Bold, HorizontalOptions = LayoutOptions.StartAndExpand, VerticalOptions = LayoutOptions.Center, VerticalTextAlignment = TextAlignment.Center, Margin = new Thickness(0, 0) }; l.SetBinding(Label.TextProperty, new Binding("Description")); firstRow.Children.Add(l); StackLayout border = new StackLayout() { WidthRequest = 150, HeightRequest = 50, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.End, Margin = new Thickness(0, 0) }; StackLayout score = new StackLayout() { Orientation = StackOrientation.Horizontal, WidthRequest = 150, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand }; StackLayout holder1 = new StackLayout() { VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.Center, WidthRequest = 105, HeightRequest = 40 }; var inputLayout1 = new SfTextInputLayout() { ContainerType = ContainerType.Outlined, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.Center, HeightRequest = 40, InputViewPadding = 0, ReserveSpaceForAssistiveLabels = false }; SfNumericTextBox points = new SfNumericTextBox() { TextAlignment = TextAlignment.Center, VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand, TextColor = Color.White, HeightRequest = 40, Margin = 0, SelectAllOnFocus = true }; points.SetBinding(SfNumericTextBox.ValueProperty, new Binding("Points", BindingMode.TwoWay)); inputLayout1.SetBinding(SfTextInputLayout.ContainerBackgroundColorProperty, new Binding("BackColor")); points.MaximumNumberDecimalDigits = 1; points.Completed += Handle_ValueChanged; points.Minimum = 0; inputLayout1.InputView = points; holder1.Children.Add(inputLayout1); StackLayout holder2 = new StackLayout() { VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.Center, WidthRequest = 105, HeightRequest = 40 }; var inputLayout2 = new SfTextInputLayout() { ContainerType = ContainerType.Outlined, VerticalOptions = LayoutOptions.StartAndExpand, HorizontalOptions = LayoutOptions.Center, HeightRequest = 40, InputViewPadding = 0, ReserveSpaceForAssistiveLabels = false }; SfNumericTextBox possible = new SfNumericTextBox() { TextAlignment = TextAlignment.Center, VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.FillAndExpand, TextColor = Color.White, HeightRequest = 40, Margin = 0, SelectAllOnFocus = true }; possible.SetBinding(SfNumericTextBox.ValueProperty, new Binding("Possible", BindingMode.TwoWay)); inputLayout2.SetBinding(SfTextInputLayout.ContainerBackgroundColorProperty, new Binding("BackColor")); possible.MaximumNumberDecimalDigits = 1; possible.Completed += Handle_ValueChanged; inputLayout2.InputView = possible; holder2.Children.Add(inputLayout2); score.Children.Add(holder1); score.Children.Add(holder2); border.Children.Add(score); border.BackgroundColor = Color.Transparent; firstRow.Children.Add(border); StackLayout subMain = new StackLayout() { Spacing = 0, Margin = 0, Padding = 0, HorizontalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Horizontal, VerticalOptions = LayoutOptions.StartAndExpand }; cat = new SfComboBox() { HorizontalOptions = LayoutOptions.StartAndExpand, WidthRequest = 200, HeightRequest = 50, TextColor = Color.White, VerticalOptions = LayoutOptions.CenterAndExpand }; cat.ComboBoxSource = Cats; cat.SelectionChanged += ComboBox_SelectionChanged; cat.SetBinding(SfComboBox.TextProperty, new Binding("AssignmentType", BindingMode.TwoWay)); subMain.Children.Add(cat); gradeBox = new SfComboBox() { HorizontalOptions = LayoutOptions.End, WidthRequest = 150, TextColor = Color.White }; gradeBox.SetBinding(SfComboBox.TextProperty, new Binding("Grade", BindingMode.TwoWay)); gradeBox.ComboBoxSource = gradesPoss; gradeBox.SelectionChanged += Gradebox_SelectionChanged; subMain.Children.Add(gradeBox); StackLayout last = new StackLayout() { Orientation = StackOrientation.Horizontal, VerticalOptions = LayoutOptions.End, HorizontalOptions = LayoutOptions.FillAndExpand, Margin = new Thickness(0, 0) }; Binding dateNTime = new Binding("Date"); dateNTime.Converter = new AssignmentDateConverter(); Label date = new Label() { TextColor = Color.White, VerticalOptions = LayoutOptions.End, FontSize = 15f, FontAttributes = FontAttributes.Bold, Margin = new Thickness(0, 0), HorizontalOptions = LayoutOptions.EndAndExpand }; date.SetBinding(Label.TextProperty, dateNTime); last.Children.Add(date); main.Children.Add(firstRow); main.Children.Add(subMain); main.Children.Add(last); main.Children.Add(new BoxView() { Color = Color.Black, HorizontalOptions = LayoutOptions.FillAndExpand, HeightRequest = 2 }); MainGrid.Children.Add(main); return(MainGrid); }); }