Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Xamarin.Forms;
- namespace ListViewDemoVS
- {
- class ListItemCell : ViewCell
- {
- public ListItemCell()
- {
- Label titleLabel = new Label
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- FontSize = 25,
- FontAttributes = Xamarin.Forms.FontAttributes.Bold,
- TextColor = Color.White
- };
- titleLabel.SetBinding(Label.TextProperty, "Title");
- Label descLabel = new Label
- {
- HorizontalOptions = LayoutOptions.FillAndExpand,
- FontSize = 12,
- TextColor = Color.White
- };
- descLabel.SetBinding(Label.TextProperty, "Description");
- Label priceLabel = new Label
- {
- HorizontalOptions = LayoutOptions.End,
- FontSize = 25,
- TextColor = Color.Aqua
- };
- priceLabel.SetBinding(Label.TextProperty, "Price");
- StackLayout viewLayoutItem = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.StartAndExpand,
- Orientation = StackOrientation.Vertical,
- Children = { titleLabel, descLabel }
- };
- StackLayout viewLayout = new StackLayout()
- {
- HorizontalOptions = LayoutOptions.StartAndExpand,
- Orientation = StackOrientation.Horizontal,
- Padding = new Thickness(25, 10, 55, 15),
- Children = { viewLayoutItem, priceLabel }
- };
- View = viewLayout;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement