public TopPanelItem(string title, View contentView = null, bool isSelected = false) { HorizontalOptions = LayoutOptions.FillAndExpand; Padding = 8; titleLabel = new DefaultLabel { Text = title, HorizontalOptions = LayoutOptions.CenterAndExpand, FontAttributes = FontAttributes.Bold, CustomFontSize = NamedSize.Small }; IsSelected = isSelected; ContentView = contentView; GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => OnTap.Dispatch()) }); Content = titleLabel; }