Advertisement
smeacham

HeaderCell.cs

May 26th, 2016
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. using Xamarin.Forms;
  8.  
  9. namespace ListViewDemoVS
  10. {
  11.     // Large black text on white background
  12.     class HeaderCell : ViewCell
  13.     {
  14.         public HeaderCell()
  15.         {
  16.             this.Height = 40;
  17.  
  18.             var title = new Label
  19.             {
  20.                 FontSize = 16,
  21.                 TextColor = Color.Black,
  22.                 VerticalOptions = LayoutOptions.Center
  23.             };
  24.             title.SetBinding(Label.TextProperty, "Key");
  25.  
  26.             View = new StackLayout
  27.             {
  28.                 HorizontalOptions = LayoutOptions.FillAndExpand,
  29.                 HeightRequest = 40,
  30.                 BackgroundColor = Color.White,
  31.                 Padding = 5,
  32.                 Orientation = StackOrientation.Horizontal,
  33.                 Children = { title }
  34.             };
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement