Exemple #1
0
        public CardView()
        {
            Grid grid = new Grid {
                Padding         = new Thickness(0, 1, 1, 1),
                RowSpacing      = 1,
                ColumnSpacing   = 1,
                BackgroundColor = CheeseColors.WHITE,
                VerticalOptions = LayoutOptions.FillAndExpand,
                RowDefinitions  =
                {
                    new RowDefinition {
                        Height = new GridLength(70, GridUnitType.Absolute)
                    },
                    new RowDefinition {
                        Height = new GridLength(30, GridUnitType.Absolute)
                    }
                },
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(4, GridUnitType.Absolute)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(150, GridUnitType.Absolute)
                    },
                }
            };

            statusView  = new CardStatusView();
            detailsView = new CardDetailsView();
            ratingView  = new RatingView(false);

            // Add the colored status view content
            grid.Children.Add(
                statusView
                , 0, 1, 0, 2);

            // Add the cheese details content
            grid.Children.Add(detailsView, 1, 4, 0, 1);

            grid.Children.Add(
                ratingView
                , 1, 1);


            var stack = new StackLayout()
            {
                Children = { grid },
                Padding  = new Thickness(0, 5, 0, 5)
            };

            this.View = stack;
        }
Exemple #2
0
		public CardView ()
		{
			Grid grid = new Grid {
				Padding = new Thickness (0, 1, 1, 1),
				RowSpacing = 1,
				ColumnSpacing = 1,		
				BackgroundColor = CheeseColors.WHITE,
				VerticalOptions = LayoutOptions.FillAndExpand,
				RowDefinitions = {
					new RowDefinition { Height = new GridLength (70, GridUnitType.Absolute) },
					new RowDefinition { Height = new GridLength (30, GridUnitType.Absolute) }
				},
				ColumnDefinitions = {
					new ColumnDefinition { Width = new GridLength (4, GridUnitType.Absolute) },
					new ColumnDefinition { Width = new GridLength (1, GridUnitType.Star) },
					new ColumnDefinition { Width = new GridLength (150, GridUnitType.Absolute) },
				}
			};
				
			statusView = new CardStatusView ();
			detailsView = new CardDetailsView ();
			ratingView = new RatingView(false);

			// Add the colored status view content
			grid.Children.Add (
				statusView
				, 0, 1, 0, 2);

			// Add the cheese details content
			grid.Children.Add (detailsView, 1, 4, 0, 1);

			grid.Children.Add (
				ratingView
				, 1, 1);


			var stack = new StackLayout () {
				Children = {grid},
				Padding = new Thickness (0, 5, 0, 5)
			};

			this.View = stack;
		}