JobITPs.xaml.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using comal.timesheets.CustomControls;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using InABox.Core;
  8. using Comal.Classes;
  9. using InABox.Clients;
  10. using Xamarin.Forms;
  11. using Xamarin.Forms.Xaml;
  12. namespace comal.timesheets.SiteITPModule
  13. {
  14. [XamlCompilation(XamlCompilationOptions.Compile)]
  15. public partial class JobITPs : SitePage
  16. {
  17. public JobITPs()
  18. {
  19. InitializeComponent();
  20. }
  21. protected override void JobLoaded()
  22. {
  23. Device.BeginInvokeOnMainThread(Refresh);
  24. }
  25. private void Refresh()
  26. {
  27. ITPs.ItemsSource = Job.ITPs;
  28. countLbl.Text = "Number of ITPs for Job: " + Job.ITPs.Length.ToString();
  29. }
  30. private void ITPs_OnOnRefreshRequested(object sender, MobileGridRefreshRequestArgs args)
  31. {
  32. Refresh();
  33. }
  34. private void ITPs_OnSelectionChanged(object sender, MobileGridSelectionArgs args)
  35. {
  36. var itp = ITPs.SelectedItems.FirstOrDefault() as JobITPShell;
  37. if (itp == null)
  38. return;
  39. JobITPDetails iTPDetailsPage = new JobITPDetails(itp);
  40. Navigation.PushAsync(iTPDetailsPage);
  41. }
  42. }
  43. }