public SampleListCell() { this.SetBinding(TypeProperty, "SampleType"); var sampleName = new LabelExt { VerticalOptions = LayoutOptions.Center }; sampleName.SetBinding(Label.TextProperty, "Title"); sampleName.VerticalOptions = LayoutOptions.Center; //if (Device.OS == TargetPlatform.Windows && Device.Idiom == TargetIdiom.Phone) // sampleName.HorizontalOptions = LayoutOptions.FillAndExpand; if (Device.Idiom == TargetIdiom.Desktop || Device.Idiom == TargetIdiom.Tablet) { sampleName.WidthRequest = 210; } sampleName.FontSize = Device.Idiom == TargetIdiom.Tablet ? DeviceExt.OnPlatform(15, 15, 25) : DeviceExt.OnPlatform(13, 13, 25); sampleName.VerticalOptions = LayoutOptions.Center; if ((Device.OS == TargetPlatform.Windows && Device.Idiom == TargetIdiom.Phone) || Device.OS == TargetPlatform.WinPhone) { sampleName.TextColor = Color.White; sampleName.FontSize = 23; } else { sampleName.TextColor = Color.Black; } if (App.Platform == Platforms.UWP && Device.Idiom == TargetIdiom.Phone) { sampleName.FontSize = 15; } rootLayout = new Grid { VerticalOptions = LayoutOptions.FillAndExpand, ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(60, GridUnitType.Absolute) } } }; if (Device.OS != TargetPlatform.Android) { rootLayout.BackgroundColor = Color.White; } sampleName.TextColor = Color.FromHex("#333D47"); if (Device.Idiom != TargetIdiom.Phone && Device.OS == TargetPlatform.Windows) { sampleName.FontSize = 15; sampleName.SetBinding(Label.TextColorProperty, new Binding("ForegroundColor")); rootLayout.SetBinding(Layout.BackgroundColorProperty, new Binding("BackgroundColor")); } rootLayout.VerticalOptions = LayoutOptions.Center; if (Device.OS == TargetPlatform.Android) { rootLayout.HorizontalOptions = LayoutOptions.StartAndExpand; } else { rootLayout.HorizontalOptions = LayoutOptions.Center; } rootLayout.Children.Add(sampleName, 0, 0); rootLayout.Padding = DeviceExt.OnPlatform(new Thickness(15, 10, 5, 5), new Thickness(15, 10, 5, 5), new Thickness(4, 3, 5, 3)); if (Ext.IsWinPhone()) { StackLayout stackLayout = new StackLayout { Children = { rootLayout }, BackgroundColor = Color.White, Padding = 0, Spacing = 0, VerticalOptions = LayoutOptions.FillAndExpand, }; View = stackLayout; } else { View = rootLayout; } }