private StackLayout SetIconsToTrail(Trail trail) { var icons = new StackLayout { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.FillAndExpand }; if (trail.DogAllowed) { icons.Children.Add(GenericsContent.CreateIcon("icon_white_dog_freindly.png")); } if (trail.GoodForKids) { icons.Children.Add(GenericsContent.CreateIcon("icon_white_good_for_kids.png")); } if (!string.IsNullOrEmpty(trail.DurationType)) { icons.Children.Add(GenericsContent.CreateWhiteIconByType(trail.DurationType)); } if (!string.IsNullOrEmpty(trail.Type)) { icons.Children.Add(GenericsContent.CreateWhiteIconByType(trail.Type)); } return(icons); }
private StackLayout GenerateStarForCommentMark(double rate) { var stack = new StackLayout { Orientation = StackOrientation.Horizontal }; for (int i = 0; i < rate; i++) { stack.Children.Add(GenericsContent.CreateIcon("gold_star_icon.png")); } return(stack); }
private Grid GenerateTableForOptions(FullTrail trail) { var table = new Grid { RowDefinitions = { new RowDefinition { Height = 50 }, new RowDefinition { Height = 50 }, new RowDefinition { Height = 50 }, new RowDefinition { Height = 50 } }, ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }, }, }; table.Children.Add(GenerateLabelForTableColumn("Distance"), 0, 0); table.Children.Add(GenerateLabelForTableValue(trail.Distance.ToString()), 1, 0); table.Children.Add(GenerateLabelForTableColumn("Peak"), 0, 1); table.Children.Add(GenerateLabelForTableValue(trail.Peak.ToString()), 1, 1); table.Children.Add(GenerateLabelForTableColumn("Season start"), 0, 2); table.Children.Add(GenerateLabelForTableValue(trail.SeasonStart), 1, 2); table.Children.Add(GenerateLabelForTableColumn("Season end"), 0, 3); table.Children.Add(GenerateLabelForTableValue(trail.SeasonEnd), 1, 3); table.Children.Add(GenerateLabelForTableColumn("Good For Kids"), 2, 0); if (trail.GoodForKids) { table.Children.Add(GenericsContent.CreateIcon("icon_black_ood_for_kids.png"), 3, 0); } table.Children.Add(GenerateLabelForTableColumn("Dog Allowed"), 2, 1); if (trail.DogAllowed) { table.Children.Add(GenericsContent.CreateIcon("icon_black_dog_freindly.png"), 3, 1); } table.Children.Add(GenerateLabelForTableColumn("Type"), 2, 2); if (!string.IsNullOrEmpty(trail.Type)) { table.Children.Add(GenericsContent.CreateBlackIconByType(trail.Type), 3, 2); } table.Children.Add(GenerateLabelForTableColumn("Duration Type"), 2, 3); if (!string.IsNullOrEmpty(trail.DurationType)) { table.Children.Add(GenericsContent.CreateBlackIconByType(trail.DurationType), 3, 3); } return(table); }