Exemplo n.º 1
0
 public GridViewAdapter(IEnumerable items, RecyclerView recyclerView, GridView2 gridView, DisplayMetrics displayMetrics)
 {
     Items = items;
     _recyclerView = recyclerView;
     Element = gridView;
     _displayMetrics = displayMetrics;
     _gridView = gridView;
 }
Exemplo n.º 2
0
		private void InitializeBottomLayout()
		{
			/*ProductGrid = new Grid () {
				Padding = 0
			};

			//PopulateGrid ();

			ProductScrollView = new ScrollView () {
				Orientation = ScrollOrientation.Vertical,
				Content = ProductGrid
			};*/
			ProductGrid = new GridView2(){};
			ProductGrid.WidthRequest = MyDevice.ScreenWidth;
			ProductGrid.RowSpacing = MyDevice.GetScaledSize (10);
			ProductGrid.ItemWidth = MyDevice.GetScaledSize (298);
			ProductGrid.ItemHeight = MyDevice.GetScaledSize (377);
			ProductGrid.SelectionEnabled = true;
			ProductGrid.ItemTemplate = new DataTemplate (typeof(ProductCellNew));
			ProductGrid.IsScrollEnabled = true;
			ProductGrid.MaxItemsPerRow = 2;
			ProductGrid.CenterAsFilledRow=true;

			ProductGrid.ItemsSource = mProductList;

			mMidLayout.Children.Add (ProductGrid,
				Constraint.Constant(0),
				Constraint.RelativeToView (mSearchLayout, (parent, sibling) => {
					return sibling.Bounds.Bottom + MyDevice.GetScaledSize(64);
				}),
				Constraint.Constant(MyDevice.GetScaledSize(630)),
				Constraint.Constant(MyDevice.ScreenHeight-MyDevice.GetScaledSize(87)-MyDevice.GetScaledSize(73)-MyDevice.GetScaledSize(1)-MyDevice.GetScaledSize(117))
			);
		}