StockLocationViewCell.xaml.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Xamarin.Forms;
  7. using Xamarin.Forms.Xaml;
  8. namespace comal.timesheets
  9. {
  10. [XamlCompilation(XamlCompilationOptions.Compile)]
  11. public partial class StockLocationViewCell : ContentView
  12. {
  13. public StockLocationShell stockLocationShell;
  14. public StockLocationViewCell (StockLocationShell _shell)
  15. {
  16. InitializeComponent ();
  17. stockLocationShell = _shell;
  18. BindingContext = stockLocationShell;
  19. poItemStackLayout.Children.Clear();
  20. foreach (POItemShell poitem in stockLocationShell.PoItems)
  21. {
  22. Grid grid = new Grid() { Margin = 1, Padding = 1};
  23. grid.RowDefinitions.Add(new RowDefinition {Height = new GridLength(1, GridUnitType.Auto)});
  24. grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) });
  25. Label label = new Label() { Text = poitem.Description, Margin = 0, FontAttributes = FontAttributes.Bold};
  26. grid.Children.Add(label);
  27. Label label1 = new Label() { Text = "Qty: " + poitem.ReceivedQty.ToString(), Margin = 0, HorizontalOptions = LayoutOptions.Center
  28. , HorizontalTextAlignment = TextAlignment.Center};
  29. grid.Children.Add(label1);
  30. Grid.SetRow(label, 0);
  31. Grid.SetRow(label1, 1);
  32. Frame frame = new Frame() { BorderColor = Color.FromHex("#c71585"), Margin = 1 , Padding = 3, CornerRadius = 10};
  33. frame.Content = grid;
  34. poItemStackLayout.Children.Add(frame);
  35. }
  36. }
  37. }
  38. }