ModalViewModel.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. 
  2. namespace ShwasherSys.Views.Shared.New.Modals
  3. {
  4. public class ModalViewModel
  5. {
  6. public ModalViewModel(string header, string modalId = "modal", int footer = 0,string sizeClass="", int? width = null)
  7. {
  8. Header = new ModalHeaderViewModel(header);
  9. Footer = footer+"";
  10. ModalId = modalId;
  11. Width = width;
  12. SizeClass = sizeClass;
  13. }
  14. public ModalViewModel(string header1, string header2, string modalId = "modal", int footer = 0,string sizeClass="", int? width = null)
  15. {
  16. Header = new ModalHeaderViewModel(header1, header2);
  17. Footer = footer+"";
  18. ModalId = modalId;
  19. Width = width;
  20. SizeClass = sizeClass;
  21. }
  22. public ModalViewModel(string header, ModalBodyViewModel body, string modalId = "modal", string footer = "0",string sizeClass="", int? width = null)
  23. {
  24. Header = new ModalHeaderViewModel(header);
  25. Body = body;
  26. Body.ModalId = modalId;
  27. Footer = footer;
  28. ModalId = modalId;
  29. Width = width;
  30. SizeClass = sizeClass;
  31. }
  32. public ModalViewModel(string header1, string header2, ModalBodyViewModel body, string modalId = "modal", int footer = 0,string sizeClass="", int? width = null)
  33. {
  34. Header = new ModalHeaderViewModel(header1, header2);
  35. Body = body;
  36. if (body != null)
  37. {
  38. Body.ModalId = modalId;
  39. }
  40. Footer = footer+"";
  41. ModalId = modalId;
  42. Width = width;
  43. SizeClass = sizeClass;
  44. }
  45. public ModalViewModel(ModalHeaderViewModel header, ModalBodyViewModel body, string modalId = "modal", int footer = 0,string sizeClass="", int? width = null)
  46. {
  47. Header = header;
  48. Body = body;
  49. Body.ModalId = modalId;
  50. Footer = footer+"";
  51. ModalId = modalId;
  52. Width = width;
  53. SizeClass = sizeClass;
  54. }
  55. public ModalHeaderViewModel Header { get; set; }
  56. public ModalBodyViewModel Body { get; set; }
  57. public string Footer { get; set; }
  58. public string ModalId { get; set; }
  59. public int? Width { get; set; }
  60. public string SizeClass { get; set; }
  61. public ModalViewModel SetModalSize( string sizeClass)
  62. {
  63. SizeClass = sizeClass;
  64. return this;
  65. }
  66. public ModalViewModel SetModalSize( int width)
  67. {
  68. Width = width;
  69. return this;
  70. }
  71. }
  72. }