Guest User

Untitled

a guest
Mar 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.ComponentModel;
  5. using System.Linq;
  6. using System.Runtime.CompilerServices;
  7. using System.ServiceModel.Channels;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Input;
  11. using Xamarin_Forms.Model;
  12. using Xamarin_Forms.Views.Popup;
  13. using Rg.Plugins.Popup.Extensions;
  14. using Xamarin.Forms;
  15. using Xamarin.Forms.Xaml;
  16.  
  17. namespace Xamarin_Forms.Views
  18. {
  19. [XamlCompilation(XamlCompilationOptions.Compile)]
  20. public partial class woTabsParts : ContentPage
  21. {
  22. public ObservableCollection<PartDto> _parts { get; set; } = new ObservableCollection<PartDto>();
  23. private ChoosePartsPopup popuppage;
  24. public event EventHandler<PartDto> ContactUpdated;
  25. public woTabsParts(PartDto part)
  26. {
  27. InitializeComponent();
  28. popuppage = new ChoosePartsPopup();
  29. popuppage.CloseWhenBackgroundIsClicked = true;
  30. // popuppage.BackgroundClicked(new BitmapDrawable());
  31. // popuppage.OutsideTouchable = true;
  32. popuppage.Disappearing += delegate (object sender, EventArgs args)
  33. // delegate(object sender, PropertyChangedEventArgs args)
  34. {
  35.  
  36. };
  37.  
  38. Title = "Parts";
  39. if (part != null)
  40. {
  41. _parts.Add(new PartDto
  42. {
  43. Code = part.Code,
  44. Description = part.Description,
  45. Quantity = part.Quantity}
  46. );
  47.  
  48. lv_partsnew.IsVisible = true;
  49. lv_partsnew.ItemsSource = _parts;
  50.  
  51.  
  52.  
  53. }
  54. // BindingContext = woTabsModelLocator.MainViewModel;
  55.  
  56.  
  57. // InitializeView();
  58.  
  59. }
  60.  
  61. //private void InitializeView()
  62. //{
  63. // //lv_parts.SetBinding(ListView.ItemsSourceProperty, "PartsWO", BindingMode.TwoWay);
  64. // _parts = new ObservableCollection<PartDto>()
  65. // {
  66. // // new PartDto{ Code = "L6FT", Description = "China Cup", Quantity = "2"},
  67. // // new PartDto{ Code = "FIL20x50", Description = "China Plate", Quantity = "2"},
  68. // // new PartDto{ Code = "L4FT", Description = "China Glass", Quantity = "2"}
  69. // };
  70.  
  71. // lv_partsnew.IsVisible = true;
  72. // lv_partsnew.ItemsSource = _parts;
  73. // // lv_partsnew.SetBinding(ListView.ItemsSourceProperty, "PartsWO", BindingMode.TwoWay);
  74. //}
  75.  
  76. private void Handle_ItemTapped(object sender, ItemTappedEventArgs e)
  77. {
  78. throw new NotImplementedException();
  79. }
  80.  
  81. private void Handle_ItemSelected(object sender, SelectedItemChangedEventArgs e)
  82. {
  83. throw new NotImplementedException();
  84. }
  85.  
  86. //private async void Btn_add_camera_part_OnClicked(object sender, EventArgs e)
  87. //{
  88. // // using a plugin to do it
  89. // // here we have ZXingNetMobile to try
  90.  
  91. //}
  92.  
  93. private async void Btn_addPart_OnClicked(object sender, EventArgs e)
  94. {
  95. await Navigation.PushPopupAsync(popuppage, false);
  96.  
  97. }
  98. }
  99. }
Add Comment
Please, Sign In to add comment