KanbanEditFormsView.xaml.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Comal.Classes;
  7. using Xamarin.Forms;
  8. using Xamarin.Forms.Xaml;
  9. namespace PRS.Mobile
  10. {
  11. [XamlCompilation(XamlCompilationOptions.Compile)]
  12. public partial class KanbanEditFormsView
  13. {
  14. public KanbanEditFormsView()
  15. {
  16. InitializeComponent();
  17. }
  18. public override void Refresh()
  19. {
  20. _formlist.DataModel = ViewModel?.Forms;
  21. _formlist.AppliesTo = "Kanban";
  22. _formlist.Property = model => ViewModel?.Forms.Items.OfType<IDigitalFormInstanceShell>().ToArray();
  23. _formlist.RefreshData(false,true);
  24. }
  25. private void _formlist_OnFormTapped(object sender, ExistingFormTappedEventArgs args)
  26. {
  27. if (args.Shell is KanbanFormShell shell)
  28. {
  29. var model = new DigitalFormHostModel<Kanban, KanbanLink, KanbanForm>();
  30. model.LoadItems(ViewModel.Item.Entity, shell.FormID, shell.ID, null);
  31. var host = new DigitalFormHost(model);
  32. host.OnClosing += (o, args) =>
  33. {
  34. if (args.Changed)
  35. {
  36. //instance.Completed = !model.DigitalFormDataModel.Instance.FormCompleted.IsEmpty();
  37. }
  38. };
  39. Navigation.PushAsync(host);
  40. }
  41. }
  42. }
  43. }