StockHoldingSelectionPage.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Linq;
  3. using InABox.Mobile;
  4. using Xamarin.Forms;
  5. namespace PRS.Mobile
  6. {
  7. public class StockHoldingSelectionPage : SelectionPage
  8. {
  9. public StockHoldingSelectionPage(StockHoldingModel model, Action<StockHoldingShell> action)
  10. : base(
  11. "Select Holding",
  12. SelectionPageMode.Immediate,
  13. (columns, filters) =>
  14. {
  15. columns
  16. .BeginUpdate()
  17. .Clear()
  18. .Add(new MobileGridTextColumn<StockHoldingShell>()
  19. { Column = x => x.JobNumber, Width = 100, Alignment = TextAlignment.Center })
  20. .Add(new MobileGridTextColumn<StockHoldingShell>()
  21. { Column = x => x.LocationCode, Width = GridLength.Star, Alignment = TextAlignment.Start })
  22. .Add(new MobileGridDoubleColumn<StockHoldingShell>()
  23. { Column = x => x.Units, Width = 50, Alignment = TextAlignment.Center, Format = "F2", Caption = "Qty"})
  24. .EndUpdate();
  25. },
  26. (args) =>
  27. {
  28. return model;
  29. },
  30. (items) => action?.Invoke(items.FirstOrDefault() as StockHoldingShell)
  31. )
  32. {
  33. }
  34. }
  35. }